How to fetch data from an Oracle sys_refcursor via PHP?

Asked

Viewed 92 times

1

I have a Package with a function where the return of it is a sys_refcursor:

FUNCTION getConfigPlaca(placa_aux VARCHAR2) RETURN sys_refcursor;

If I consult this function with a "from dual" I get:

{<SENSOR=1,LIMITE_MAXIMO=+28,LIMITE_MINIMO=+24,LIMITE_ATIVO=0>,<SENSOR=2,LIMITE_MAXIMO=+40,LIMITE_MINIMO=+01,LIMITE_ATIVO=0>,}

I’m not able to handle this data properly searching through PHP, someone could give me a clue how I can proceed?

1 answer

0


In php there is an OCI8 library, which is used for example for this type of problem.

In php.net there is an example of how to use this type of return which is a type of data existing only in ORACLE. In your case you’d use the oci_new_cursor that allocates and returns a cursor.

Explanation link: [http://php.net/manual/en/function.oci-new-cursor.php]

  • You solved my problem, thank you;

  • Show, if you can raise the level of my answer to a level above I would be grateful :)

Browser other questions tagged

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