RE: [PHP-DB] Oracle stored procedure help...
| From: | Andrew Hill | Date: | Thu, 14 Sep 2000 15:52:51 +0000 |
| Subject: | RE: [PHP-DB] Oracle stored procedure help... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-2884@lists.php.net to get a copy of this message | ||
You could review the RFC that deals with PSM96, which is the division of SQL
spec that deals with stored procedure language, and is what PL/SQL is based
on. That _does_ read a bit like stereo instructions though :)
Try a book by Jim Melton, titled "PSM96, Understanding SQL's Stored Modules"
which is the best book on the subject, and not proprietary to Oracle, so you
will learn transferrable skills. It is example based, and will answer all
your questions about Cursors, which are really the biggest part of stored
procedures with regards to interaction with an exteral programming language
such as PHP.
HTH!
Best regards,
Andrew
----------------------------------------------------
Andrew Hill
Professional Services Consultant
OpenLink Software
http://www.openlinksw.com
XML & E-Business Infrastructure Technology Provider
> -----Original Message-----
> From: Paulson, Joseph V. "Jay" [mailto:jay.paulson@viatel.com]
> Sent: Thursday, September 14, 2000 11:40 AM
> To: 'Thies Arntzen'
> Cc: 'php-db@lists.php.net'
> Subject: RE: [PHP-DB] Oracle stored procedure help...
>
>
> Well I'm new to this and I was trying to figure out how stored procedures
> from oracle worked with php... Even though it works now (THANKS A LOT!) I
> still don't understand it totally... for example I still don't even have a
> clue as to what OCINewCursor is or why you need you even need it.
>
> Does anyone know were I could find a good tutorial or book on how to use
> oracle's stored procedures in php so I can know what each function in php
> does? I'd prefer something that doesn't read like stereo instruction! :)
>
> Thanks again!
> Jay Paulson
>
> -----Original Message-----
> From: Thies Arntzen [mailto:thies@digicol.de]
> Sent: Thursday, September 14, 2000 10:08 AM
> To: Paulson, Joseph V. "Jay"
> Cc: 'php-db@lists.php.net'
> Subject: Re: [PHP-DB] Oracle stored procedure help...
>
>
> > //connect to db
> > $conn = OCILogon("username","password","db");
> > $curs = OCINewCursor($conn);
>
> don't need OCINewCursor
>
> just do:
>
> $stmt = OCIParse($conn,"begin NAC_CONTACT_ADD(:P_RETURN_CODE,
> :P_RETURN_MSG, :p_acct_no, :p_div, > :p_CDE_ACTION, :p_name,
> :p_PHONE_NO, :p_PHONE_TYPE, > :p_login_id, null,
> :p_commit); end;");
>
> declare is not sql - it's sqlplus'es way of creating bind
> variables.
>
> ocibindbyname($stmt,"P_RETURN_CODE",&$P_RETURN_CODE,28);
> ocibindbyname($stmt,"P_RETURN_MSG",&$P_RETURN_MSG,255);
>
> .. rest of the binds ...
>
> why would you want to use a cursor when you're expections a
> NUMBER and VARCHAR2 back?
>
>
> 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
>
>