Welcome Guest, Not a member yet? Register   Sign In
Oracle cursor problem
#1

[eluser]Unknown[/eluser]
Hello. I`m a new user of the codeignitor. Trying to get data from the oracle base using a CodeIgniter functioanality. My user function (which is listed below) returning a refcursor. And I can not rich the data from it. CodeIgniter always return an error like this:

Message: ocibindbyname() [function.ocibindbyname]: Error while trying to retrieve text for error ORA-01036

here is the code:
Code:
public function getAll() {
        $curs = $this->db->get_cursor();
        $params=array(
                    array('name'=>'data', 'value'=>&$curs, 'type'=>OCI_B_CURSOR, 'length'=>-1)
            );
        return $this->db->stored_procedure("TEST","GETDATA" ,$params);
    }

Here is an oracle function:
Code:
RETURN SYS_REFCURSOR IS
     RESULT SYS_REFCURSOR;
BEGIN
     OPEN RESULT FOR
          SELECT NAME
          FROM TABLE;
     RETURN RESULT;
END;

And here is the example of the php code (without a codeignitor framework) which returns me a normal data.

Code:
$conn = oci_connect("login", "pass", $db, 'UTF-8');
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn,"begin :data := package.procedure(); end;");

ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
oci_execute($stmt);
oci_execute($curs);

while (OCIFetchInto($curs,&$data)) {
   var_dump($data);
}

OCIFreeStatement($stmt);
OCIFreeCursor($curs);
OCILogoff($conn);

Please help me to understand how to use it with cursors.


Messages In This Thread
Oracle cursor problem - by El Forum - 05-30-2008, 01:33 AM
Oracle cursor problem - by El Forum - 05-30-2008, 09:14 PM
Oracle cursor problem - by El Forum - 06-02-2008, 01:11 AM
Oracle cursor problem - by El Forum - 06-02-2008, 01:20 AM
Oracle cursor problem - by El Forum - 06-02-2008, 01:25 AM
Oracle cursor problem - by El Forum - 10-28-2009, 09:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB