Return of the oci_new_cursor

Asked

Viewed 32 times

1

Hello! I have the following question: the oracle function for PHP oci_new_cursor, can only be used when the cursor already exists in the database?

For example, I just created my query within my php code:

$query2 = "DECLARE
v_consulta NUMBER;
CURSOR cursbv IS
 SELECT proxnumorc FROM pcconsum FOR UPDATE of proxnumorc;
 BEGIN
   OPEN cursbv;
     FETCH cursbv INTO v_consulta;
     UPDATE pcconsum SET proxnumorc = proxnumorc + 1;
     COMMIT;
   CLOSE cursbv;
 END;";


$s2 = oci_parse($c, $query2);

$r2 = oci_execute($s2);

Can I use this function in my code? Because I need to recover the value of the select that is inside the cursor. Obs: I’m using oracle 11g. If anyone knows how it works and can help me. Thank you in advance

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.