Just started using OCI8 functions to access an Oracle 8.0.5 database. I am able to send bind parameters, but unable to retrieve them. I have the following code:
# Create Session
$new_session_query = "
BEGIN
SESSION_PKG.GET_NEW_SESSION(
:user_id,
:session_id);
END;
";
$new_session = OCIParse($conn,$new_session_query);
OCIBindByName($new_session,":user_id",$user_id,10);
OCIBindByName($new_session,":session_id",$session_id,10);
OCIExecute($new_session);
OCIFetch($new_session);
I get the error:
OCIFetch: ORA-24374: define not done before fetch or execute and fetch
Obviously I have dropped the '&' reference character to eliminate the errors about it's use being deprecated under PHP 4.0.6. It seems to work fine for input values, but seems like the cause of my problem for input values.
I've also read that you must define the variable before binding it for output. I added the line:
$session_id = 100000;
at the top of the code, but to no avail.
The returned value at this point is only a two digit number, but could grow rapidly.
Any help greatly appreciated. And I'm gonna use the hair I've lost on this problem to bind a book on using OCI8 with PHP!
Tony
# Create Session
$new_session_query = "
BEGIN
SESSION_PKG.GET_NEW_SESSION(
:user_id,
:session_id);
END;
";
$new_session = OCIParse($conn,$new_session_query);
OCIBindByName($new_session,":user_id",$user_id,10);
OCIBindByName($new_session,":session_id",$session_id,10);
OCIExecute($new_session);
OCIFetch($new_session);
I get the error:
OCIFetch: ORA-24374: define not done before fetch or execute and fetch
Obviously I have dropped the '&' reference character to eliminate the errors about it's use being deprecated under PHP 4.0.6. It seems to work fine for input values, but seems like the cause of my problem for input values.
I've also read that you must define the variable before binding it for output. I added the line:
$session_id = 100000;
at the top of the code, but to no avail.
The returned value at this point is only a two digit number, but could grow rapidly.
Any help greatly appreciated. And I'm gonna use the hair I've lost on this problem to bind a book on using OCI8 with PHP!
Tony