Re: euRE: [PHP-DB] Passing NULL to OCIBindByName()

From: Date: Wed, 21 Jun 2000 15:29:13 +0000
Subject: Re: euRE: [PHP-DB] Passing NULL to OCIBindByName()
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-544@lists.php.net to get a copy of this message
On Tue, Jun 20, 2000 at 04:46:33PM -0400, Fred M. Bulah wrote: > > I've tried unsuccessfully to bind to a stored procedure with an output > parameter whose type is a user-defined record type. For example (taken from > a package): > > TYPE CustAcctRec IS RECORD( > custID NUMBER, > acctID NUMBER > ); > > PROCEDURE findAcct( custID IN NUMBER, custAcct OUT CustAcctRec ) > IS > BEGIN > ... > END; > > Is it possible to do so? user types are not supported (yet). could you send me a sqlplus script that shows how to use user-types? > > I also have not been able to get a function to execute. > I've tried > $stmt = OCIParse( $conn, "begin retval = func(); end;" ); > and > $stmt = OCIParse( $conn, "declare retval NUMBER; begin retval = func(); > end;" ); both methods in "action" <?php $conn = ocilogon("scott","tiger"); $s = ociparse($conn,"begin :d := sysdate(); end;"); ocibindbyname($s,"d",&$d,32); ociexecute($s); var_dump($d); ?> -or- <?php $conn = ocilogon("scott","tiger"); $s = ociparse($conn,"select sysdate as thieso from dual"); ociexecute($s); ocifetch($s); var_dump(ociresult($s,"THIESO")); ?> tc > > Questions: > - Do you need to perform a bind? If so, how? > - If not, how do get the return value? > > > -----Original Message----- > From: thies@digicol.de [mailto:thies@digicol.de] > Sent: Monday, June 19, 2000 9:52 AM > To: Fred M. Bulah > Cc: php-db@lists.php.net > Subject: Re: [PHP-DB] Passing NULL to OCIBindByName() > > > On Mon, Jun 19, 2000 at 06:51:53AM -0400, Fred M. Bulah wrote: > .. > > > > FB: > > 1. ROWTYPE is a PL/SQL directive that defines a record with the same > columns > > as the given table. In the above example, customer_rec is defined as a > > record with the same structure (columns) as the table Customer. Further, > > you can define your own types using the TYPE directive. Is it possible to > > bind to these types when they are declared as output parameters. > > > > 2. How do you bind (via OCIBindByName) to the function return values in > both > > of the cases you cite ("begin retval = funcname(); end" and "select > > funcname() from dual")? Should the first be > > $stmt = OCIParse( $conn, "begin :retval = funcname(); end" ); > > OCIBindByName( $stmt, ":retval", &$retval, 32 ); > > in the select case there's no need to bind (obviously). the > other case would work as you described. > > > > > > > > > > - How do you execute a stored procedure that executes a select that has > an > > > output > > > parameter declared as a table ROWTYPE or user-defined type ? The issue > > here > > > is the > > > binding to the output parameter. > > > > i don't know ROWTYPE stuff at all - maybe send me a *TINY* > > (10 lines php + 10 lines sql) testcase so i can see what > > you're talking about. > > fred, i don't know rowtype types, and i won't answer any more > questions on this issue unless somebody sends me a (i've > said the following too many times - maybe i get heart this > time;) short, self-containig test case that lets me "play > around", understand and reproduce. right now i'd say that > ROWTYPE might not be supported in the oracle-oci8 interface, > but i might be wrong. > > tc > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-db-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > > -- > > > > Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" > > Digital Collections Phone +49 40 235350 Fax +49 40 23535180 > > Hammerbrookstr. 93 20097 Hamburg / Germany > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: php-db-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > > Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" > Digital Collections Phone +49 40 235350 Fax +49 40 23535180 > Hammerbrookstr. 93 20097 Hamburg / Germany > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.db (#544) next »