Re: Ora_Fetch_Into function problem
| From: | Michael Virnstein | Date: | Mon, 27 May 2002 09:42:43 +0000 |
| Subject: | Re: Ora_Fetch_Into function problem | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99347@lists.php.net to get a copy of this message | ||
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" <mikecarel@teamglac.com> schrieb im Newsbeitrag
news:006a01c2055b$fbfcb280$4301a8c0@teamglac.com...
>
>
>
>
>
>
>
>
> oooppssss...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)."<BR>";
> > > exit;
> > > }
> > > $cursor= Ora_Open($connection);
> > > if($cursor==false){
> > > echo Ora_ErrorCode($connection).":".
> > Ora_Error($connection)."<BR>";
> > > 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)."<BR>";
> > > exit;
> > > }
> > > $result=Ora_Exec($cursor);
> > > if($result==false){
> > > echo Ora_ErrorCode($connection).":".
> > Ora_Error($connection)."<BR>";
> > > exit;
> > > }
> > > echo"<table border=1>";
> > > echo"<tr><td><b>Full
> > > Name</b></td><td><b>Email Address</b></td></tr>";
> > > //$values=array(mike, tess);
> > > while(Ora_Fetch_Into($cursor,$values)){
> > > $name = $values[0];
> > > $email = $values[1];
> > > echo
> > > "<tr><td>$name</td><td>$email</td></tr>";
> > > echo "$email";
> > > print($name);
> > > $result =1;
> > > }
> > > if(!$result==1) print("no result");
> > > echo"</table>";
> > >
> > > 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_SID=PROD");
> > > > > 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"<table border=1>";
> > > > > echo"<tr><td><b>Full
> > > > > Name</b></td><td><b>Email
> Address</b></td></tr>";
> > > > > while(Ora_Fetch_Into($cursor,$values)){
> > > > > $name = $values[0];
> > > > > $email = $values[1];
> > > > > echo
> > > > > "<tr><td>$name</td><td>$email</td></tr>";
> > > > > }
> > > > > 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
>