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

From: Date: Mon, 19 Jun 2000 10:58:14 +0000
Subject: RE: [PHP-DB] Passing NULL to OCIBindByName()
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-475@lists.php.net to get a copy of this message
-----Original Message----- From: Fred M. Bulah [mailto:fredb@corecam.com] Sent: Monday, June 19, 2000 6:52 AM To: thies@digicol.de Cc: php-db@lists.php.net Subject: RE: [PHP-DB] Passing NULL to OCIBindByName() -----Original Message----- From: thies@digicol.de [mailto:thies@digicol.de] Sent: Monday, June 19, 2000 8:39 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 05:47:05AM -0400, Fred M. Bulah wrote: > > Thanks. Did you see my earlier mail regarding invocation of functions? > I've included a copy here. > > > -----Original Message----- > From: thies@digicol.de [mailto:thies@digicol.de] > Sent: Monday, June 19, 2000 4:44 AM > To: Fred M. Bulah > Cc: php-db@lists.php.net > Subject: Re: [PHP-DB] Passing NULL to OCIBindByName() > > > On Sun, Jun 18, 2000 at 02:44:37PM -0400, Fred M. Bulah wrote: > > > > Question: How do you pass a NULL value using OCIBindByName()? > > $name = NULL; > ocibindbyname($s,"name",&$name,0); > > > > > -- > > 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 > From: "Fred Bulah" <fredb@corecam.com> > To: <php-db@lists.php.net> > Subject: [PHP-DB] OCI8 Stored Procedure and Functions > Date: Fri, 16 Jun 2000 18:28:38 -0400 > X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.8 i86pc) > X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 > X-Accept-Language: en > list-unsubscribe: > <mailto:php-db-unsubscribe@lists.php.net> > list-help: <mailto:php-db-help@lists.php.net> > > > I've defined a package that contains the following type, function and > procedure: > > TYPE CustAcct IS RECORD > ( > customerId NUMBER, > accountId NUMBER > ); > > PROCEDURE isRegisteredP( userId IN VARCHAR2, > ca_rec OUT CustAcct) > IS > u_id VARCHAR2(32); > BEGIN > u_id := userId; > SELECT customerId, accountId INTO ca_rec FROM Customer WHERE userId = u_id; > END isRegisteredP; > > > FUNCTION isRegisteredF( userId IN VARCHAR2) return Customer%ROWTYPE > IS > u_id VARCHAR2(32); > customerRec Customer%ROWTYPE; > BEGIN > u_id := userId; > SELECT * INTO customerRec FROM Customer WHERE userId = u_id; > return( customerRec ); > END isRegisteredF; > > Questions: > > - How do you execute a function in a package from OCIExecute()? Part of the > problem > is setting up the variable to store the return value which in this case is a > record > defined as the ROWTYPE of a table. don't know about rowtype - but functions should be called eiter usinf anonymouse PLSQL ("begin retval = funcname(); end") or using "select funcname() from dual". both should work. 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 ); FB2: And what if, in the above 1st case, the return value is a user-defined type or %ROWTYPE and not a simple scalar? > > - 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. > > > -- > 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 -- 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

« previous php.db (#475) next »