php - Geting: Warning: oci_fetch(): ORA-24374: define not done before fetch or execute and fetch. despite having defined the names -


after reading every manual find still can't come solution on problem.

i have following code:

<?php  $token = 'number'; $secret = 'number'; $id;  $conn = oci_connect('fitbit', 'pass', '127.0.0.1/xe'); $stid = oci_parse($conn, 'begin find_personsdevice_id(:token, :secret, :l_personsdeviceid); end;'); oci_bind_by_name($stid, ':token', $token); oci_bind_by_name($stid, ':secret', $secret); oci_bind_by_name($stid, ':l_personsdeviceid', $id);  oci_define_by_name($stid, 'l_personsdeviceid', $id); oci_define_by_name($stid, ':token,', $token); oci_define_by_name($stid, ':secret,', $secret);  oci_execute($stid); oci_fetch($stid); var_dump($stid);  ?> 

the procedure functioning, tested sql developer , gives right result. when try call in php script following message:

warning: oci_fetch(): ora-24374: define not done before fetch or execute , fetch in

i googled ora code , found this:

cause: application did not define output variables data being fetched before issuing fetch call or invoking fetch specifying non-zero row count in execute call. action: issue oci define calls columns fetched.

as far can tell put oci_fetch command after define commands. doing wrong?

the pl/sql procedure:

create or replace procedure find_personsdevice_id(b_token in varchar2, b_secret in varchar2, l_personsdeviceid out number)  /*author ruben jonkers   project: fitbit   goal procedure: find id token , seccret   date: 20-05-2015   version:0.1   adjustments: */   cursor c_personsdeviceid (b_token in varchar2:='', b_secret in varchar2:='')   select pde.id    personsdevices pde,        persons psn,        groups grp,        tokens tns   psn.id=pde.persons_id   , pde.persons_id = psn.id   , grp.tokens_id = tns.id   , tns.token = b_token   , tns.secret = b_secret;    r_personsdeviceid c_personsdeviceid%rowtype;  begin   open c_personsdeviceid (b_token,                            b_secret);   fetch c_personsdeviceid r_personsdeviceid;     if c_personsdeviceid%found       l_personsdeviceid:=r_personsdeviceid.id;     end if;   close c_personsdeviceid;  end; 

turned out didn't need oci_fetch @ since result stored in $id!


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -