Re: [PHP] Ora_Fetch_Into function problem
if you are a newbie to oracle, don't forget to use bind variables in your queries, if this is possible in your Oracle Version. bindvars are placeholders for values in an oracle query, to which you bind your value on runtime. the advantage in using bind variables is, that oracle doesn't have to compile your query every time, but can reuse the compiled version of your query, simply bind the values and execute it. this is a main factor in writing highly scalable application with an oracle database backend, at least with Oracle8i. You can read more about that at http://asktom.oracle.com I'd provide a direct link, but i can't access the page at the moment... seems to be down. Michael "Michael P. Carel" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 006a01c2055b$fbfcb280$[EMAIL PROTECTED]">news:006a01c2055b$fbfcb280$[EMAIL PROTECTED]... > > > > > > > > > ooopp...sorry just found out why. I just need to have Ora_Commit() > function after all the queries to totally set the data to the database. > Im querying a data which is not commited yet to the oracle database. > Sorry for that I'm just a newbie in oracle. > > Thanks to all.. > > mike > > > > > > I've recently found out that the Ora_Fetch_Into function cannot get a > small > > value of the tables data. We've tried to fetch other tables which have a > > large amount data ,and it succeeds. The queried values echoed > successfully. > > Is there any idea why? im using PHP4.2.1 oracle7.3.3 > > > > > > Regards, > > Mike > > > > > > > > > > > > > thanks miguel but i've already checked it, i've included return values > > > checking where it stop. Here's my full source test script. > > > There where no Ora_Error_Code returned. > > > > > > > > PutEnv("ORACLE_SID=PROD"); > > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod"); > > > $connection = Ora_Logon("apps","apps"); > > > if($connection==false){ > > > echo Ora_ErrorCode($connection).":". > > Ora_Error($connection).""; > > > exit; > > > } > > > $cursor= Ora_Open($connection); > > > if($cursor==false){ > > > echo Ora_ErrorCode($connection).":". > > Ora_Error($connection).""; > > > exit; > > > } > > > $query = "select * from mikecarel"; > > > //$query = "select table_name from all_tables"; > > > $result = Ora_Parse($cursor,$query); > > > if($result==false){ > > > echo Ora_ErrorCode($connection).":". > > Ora_Error($connection).""; > > > exit; > > > } > > > $result=Ora_Exec($cursor); > > > if($result==false){ > > > echo Ora_ErrorCode($connection).":". > > Ora_Error($connection).""; > > > exit; > > > } > > > echo""; > > > echo"Full NameEmail Address"; > > > //$values=array(mike, tess); > > > while(Ora_Fetch_Into($cursor,$values)){ > > > $name = $values[0]; > > > $email = $values[1]; > > > echo "$name$email"; > > > echo "$email"; > > > print($name); > > > $result =1; > > > } > > > if(!$result==1) print("no result"); > > > echo""; > > > > > > ora_close($cursor); > > > ora_logoff($connection); > > > ?> > > > > > > > > > mike > > > > > > > > > > > > > Check the return values from your ora_logon, ora_open, ora_parse, and > > > > ora_exec calls to see whether they worked. That way you can know at > > > > which stage it stopped working. > > > > > > > > miguel > > > > > > > > On Mon, 27 May 2002, Michael P. Carel wrote: > > > > > Finally i've set-up my AIX server with PHP and oracle support. > Thanks > > > for > > > > > all who helps me for the configure setup. > > > > > Now I have a problem in oracle function regarding the retrieval of > > > entries > > > > > in the oracle table. The Ora_Fetch_Into function doesnt work > properly > > to > > > me > > > > > or i have an error in which i dont know. I've written below the > code > > > that i > > > > > used to test, it doesnt echo the value of $name and $email. My query > > > works > > > > > if i've enter it manually with my Oracle server. I really dont know > > why > > > im > > > > > just a newbie with this database(oracle) statement. > > > > > > > > > > Please help us here. Thanks in advance. > > > > > > > > > > > > > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod"); > > > > > $connection = Ora_Logon("apps","apps"); > > > > > $cursor= Ora_Open($connection); > > > > > > > > > > $query = "select * from mikecarel"; > > > > > $result = Ora_Parse($cursor,$query); > > > > > $result=Ora_Exec($cursor); > > > > > echo""; > > > > > echo"Full NameEmail > Address"; > > > > > while(Ora_Fetch_Into($cursor,$values)){ > > > > > $name = $values[0]; > > > > > $email = $values[1]; > > > > > echo "$name$email"; > > > > > } > > > > > ora_close($cursor); > > > > > ora_logoff($connection); ?> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Regards, > > > > > mike > > > > > > > > > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > > PHP General Mailing List (http://www.php.net/
Re: [PHP] Ora_Fetch_Into function problem
ooopp...sorry just found out why. I just need to have Ora_Commit() function after all the queries to totally set the data to the database. Im querying a data which is not commited yet to the oracle database. Sorry for that I'm just a newbie in oracle. Thanks to all.. mike > I've recently found out that the Ora_Fetch_Into function cannot get a small > value of the tables data. We've tried to fetch other tables which have a > large amount data ,and it succeeds. The queried values echoed successfully. > Is there any idea why? im using PHP4.2.1 oracle7.3.3 > > > Regards, > Mike > > > > > > > thanks miguel but i've already checked it, i've included return values > > checking where it stop. Here's my full source test script. > > There where no Ora_Error_Code returned. > > > > > PutEnv("ORACLE_SID=PROD"); > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod"); > > $connection = Ora_Logon("apps","apps"); > > if($connection==false){ > > echo Ora_ErrorCode($connection).":". > Ora_Error($connection).""; > > exit; > > } > > $cursor= Ora_Open($connection); > > if($cursor==false){ > > echo Ora_ErrorCode($connection).":". > Ora_Error($connection).""; > > exit; > > } > > $query = "select * from mikecarel"; > > //$query = "select table_name from all_tables"; > > $result = Ora_Parse($cursor,$query); > > if($result==false){ > > echo Ora_ErrorCode($connection).":". > Ora_Error($connection).""; > > exit; > > } > > $result=Ora_Exec($cursor); > > if($result==false){ > > echo Ora_ErrorCode($connection).":". > Ora_Error($connection).""; > > exit; > > } > > echo""; > > echo"Full NameEmail Address"; > > //$values=array(mike, tess); > > while(Ora_Fetch_Into($cursor,$values)){ > > $name = $values[0]; > > $email = $values[1]; > > echo "$name$email"; > > echo "$email"; > > print($name); > > $result =1; > > } > > if(!$result==1) print("no result"); > > echo""; > > > > ora_close($cursor); > > ora_logoff($connection); > > ?> > > > > > > mike > > > > > > > > > Check the return values from your ora_logon, ora_open, ora_parse, and > > > ora_exec calls to see whether they worked. That way you can know at > > > which stage it stopped working. > > > > > > miguel > > > > > > On Mon, 27 May 2002, Michael P. Carel wrote: > > > > Finally i've set-up my AIX server with PHP and oracle support. Thanks > > for > > > > all who helps me for the configure setup. > > > > Now I have a problem in oracle function regarding the retrieval of > > entries > > > > in the oracle table. The Ora_Fetch_Into function doesnt work properly > to > > me > > > > or i have an error in which i dont know. I've written below the code > > that i > > > > used to test, it doesnt echo the value of $name and $email. My query > > works > > > > if i've enter it manually with my Oracle server. I really dont know > why > > im > > > > just a newbie with this database(oracle) statement. > > > > > > > > Please help us here. Thanks in advance. > > > > > > > > > > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod"); > > > > $connection = Ora_Logon("apps","apps"); > > > > $cursor= Ora_Open($connection); > > > > > > > > $query = "select * from mikecarel"; > > > > $result = Ora_Parse($cursor,$query); > > > > $result=Ora_Exec($cursor); > > > > echo""; > > > > echo"Full NameEmail Address"; > > > > while(Ora_Fetch_Into($cursor,$values)){ > > > > $name = $values[0]; > > > > $email = $values[1]; > > > > echo "$name$email"; > > > > } > > > > ora_close($cursor); > > > > ora_logoff($connection); ?> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Regards, > > > > mike > > > > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ora_Fetch_Into function problem
I've recently found out that the Ora_Fetch_Into function cannot get a small value of the tables data. We've tried to fetch other tables which have a large amount data ,and it succeeds. The queried values echoed successfully. Is there any idea why? im using PHP4.2.1 oracle7.3.3 Regards, Mike > thanks miguel but i've already checked it, i've included return values > checking where it stop. Here's my full source test script. > There where no Ora_Error_Code returned. > > PutEnv("ORACLE_SID=PROD"); > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod"); > $connection = Ora_Logon("apps","apps"); > if($connection==false){ > echo Ora_ErrorCode($connection).":". Ora_Error($connection).""; > exit; > } > $cursor= Ora_Open($connection); > if($cursor==false){ > echo Ora_ErrorCode($connection).":". Ora_Error($connection).""; > exit; > } > $query = "select * from mikecarel"; > //$query = "select table_name from all_tables"; > $result = Ora_Parse($cursor,$query); > if($result==false){ > echo Ora_ErrorCode($connection).":". Ora_Error($connection).""; > exit; > } > $result=Ora_Exec($cursor); > if($result==false){ > echo Ora_ErrorCode($connection).":". Ora_Error($connection).""; > exit; > } > echo""; > echo"Full NameEmail Address"; > //$values=array(mike, tess); > while(Ora_Fetch_Into($cursor,$values)){ > $name = $values[0]; > $email = $values[1]; > echo "$name$email"; > echo "$email"; > print($name); > $result =1; > } > if(!$result==1) print("no result"); > echo""; > > ora_close($cursor); > ora_logoff($connection); > ?> > > > mike > > > > > Check the return values from your ora_logon, ora_open, ora_parse, and > > ora_exec calls to see whether they worked. That way you can know at > > which stage it stopped working. > > > > miguel > > > > On Mon, 27 May 2002, Michael P. Carel wrote: > > > Finally i've set-up my AIX server with PHP and oracle support. Thanks > for > > > all who helps me for the configure setup. > > > Now I have a problem in oracle function regarding the retrieval of > entries > > > in the oracle table. The Ora_Fetch_Into function doesnt work properly to > me > > > or i have an error in which i dont know. I've written below the code > that i > > > used to test, it doesnt echo the value of $name and $email. My query > works > > > if i've enter it manually with my Oracle server. I really dont know why > im > > > just a newbie with this database(oracle) statement. > > > > > > Please help us here. Thanks in advance. > > > > > > > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod"); > > > $connection = Ora_Logon("apps","apps"); > > > $cursor= Ora_Open($connection); > > > > > > $query = "select * from mikecarel"; > > > $result = Ora_Parse($cursor,$query); > > > $result=Ora_Exec($cursor); > > > echo""; > > > echo"Full NameEmail Address"; > > > while(Ora_Fetch_Into($cursor,$values)){ > > > $name = $values[0]; > > > $email = $values[1]; > > > echo "$name$email"; > > > } > > > ora_close($cursor); > > > ora_logoff($connection); ?> > > > > > > > > > > > > > > > > > > > > > > > > Regards, > > > mike > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ora_Fetch_Into function problem
thanks miguel but i've already checked it, i've included return values checking where it stop. Here's my full source test script. There where no Ora_Error_Code returned. "; exit; } $cursor= Ora_Open($connection); if($cursor==false){ echo Ora_ErrorCode($connection).":". Ora_Error($connection).""; exit; } $query = "select * from mikecarel"; //$query = "select table_name from all_tables"; $result = Ora_Parse($cursor,$query); if($result==false){ echo Ora_ErrorCode($connection).":". Ora_Error($connection).""; exit; } $result=Ora_Exec($cursor); if($result==false){ echo Ora_ErrorCode($connection).":". Ora_Error($connection).""; exit; } echo""; echo"Full NameEmail Address"; //$values=array(mike, tess); while(Ora_Fetch_Into($cursor,$values)){ $name = $values[0]; $email = $values[1]; echo "$name$email"; echo "$email"; print($name); $result =1; } if(!$result==1) print("no result"); echo""; ora_close($cursor); ora_logoff($connection); ?> mike > Check the return values from your ora_logon, ora_open, ora_parse, and > ora_exec calls to see whether they worked. That way you can know at > which stage it stopped working. > > miguel > > On Mon, 27 May 2002, Michael P. Carel wrote: > > Finally i've set-up my AIX server with PHP and oracle support. Thanks for > > all who helps me for the configure setup. > > Now I have a problem in oracle function regarding the retrieval of entries > > in the oracle table. The Ora_Fetch_Into function doesnt work properly to me > > or i have an error in which i dont know. I've written below the code that i > > used to test, it doesnt echo the value of $name and $email. My query works > > if i've enter it manually with my Oracle server. I really dont know why im > > just a newbie with this database(oracle) statement. > > > > Please help us here. Thanks in advance. > > > > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod"); > > $connection = Ora_Logon("apps","apps"); > > $cursor= Ora_Open($connection); > > > > $query = "select * from mikecarel"; > > $result = Ora_Parse($cursor,$query); > > $result=Ora_Exec($cursor); > > echo""; > > echo"Full NameEmail Address"; > > while(Ora_Fetch_Into($cursor,$values)){ > > $name = $values[0]; > > $email = $values[1]; > > echo "$name$email"; > > } > > ora_close($cursor); > > ora_logoff($connection); ?> > > > > > > > > > > > > > > > > Regards, > > mike > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ora_Fetch_Into function problem
Check the return values from your ora_logon, ora_open, ora_parse, and ora_exec calls to see whether they worked. That way you can know at which stage it stopped working. miguel On Mon, 27 May 2002, Michael P. Carel wrote: > Finally i've set-up my AIX server with PHP and oracle support. Thanks for > all who helps me for the configure setup. > Now I have a problem in oracle function regarding the retrieval of entries > in the oracle table. The Ora_Fetch_Into function doesnt work properly to me > or i have an error in which i dont know. I've written below the code that i > used to test, it doesnt echo the value of $name and $email. My query works > if i've enter it manually with my Oracle server. I really dont know why im > just a newbie with this database(oracle) statement. > > Please help us here. Thanks in advance. > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod"); > $connection = Ora_Logon("apps","apps"); > $cursor= Ora_Open($connection); > > $query = "select * from mikecarel"; > $result = Ora_Parse($cursor,$query); > $result=Ora_Exec($cursor); > echo""; > echo"Full NameEmail Address"; > while(Ora_Fetch_Into($cursor,$values)){ > $name = $values[0]; > $email = $values[1]; > echo "$name$email"; > } > ora_close($cursor); > ora_logoff($connection); ?> > > > > > > > > Regards, > mike > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php