Re: Oracle stored procedures

From: Date: Thu, 06 Apr 2006 17:31:21 +0000
Subject: Re: Oracle stored procedures
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-233388@lists.php.net to get a copy of this message
I am using PHP with Oracle, but not executing stored procedures..... I assume you are already validating the contents of the $addr variable before you bind it? Otherwise, no real ideas here... -B Jay Blanchard wrote:
[snip] I have a stored procedure in Oracle;
p_BILL_TO_ADDRESS1         IN CONT_ADDRESS.ADDRESS1%TYPE
Default NULL, --VC(50) With a condition; IF p_BILL_TO_ADDRESS1 is NULL THEN Raise_Application_Error(-20100,'BILL TO Address cannot be a NULL Value'); END IF; I have some PHP code that tries to insert the data; $addr = '1234 Main'; $sth = oci_parse($conn, "begin D_ACCT_NEW(:p_BILL_TO_ADDRESS1, :P_Error_Return );end;"); oci_bind_by_name($sth, ":p_BILL_TO_ADDRESS1", $addr, -1); oci_bind_by_name($sth, ":P_Error_Return", $errorcode, -1); oci_execute($sth); echo $errorcode; And I always get the following error; Warning: oci_execute() [function.oci-execute]: ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYSADM.D_ACCT_NEW", line 483 ORA-20100: BILL TO Address cannot be a NULL Value ORA-06512: at line 1 in /home/foo/bar/glorp.php on line 25 If anyone on the list understands the intricacies of Oracle, could you sooth my aching head and help me to understand what is going on here? I have RTFM and the following article from the PHP Oracle Cookbook; http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks _sps.html ;and I still am clueless. Thanks a million in advance! [/snip] I hate to bring this up again, but is anyone on the list using PHP with Oracle?


« previous php.general (#233388) next »