Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: fetch out of sequence
I doesn' t understand what you talking about :
This is the code :
<?php
$conn = OCILogon("user", "pwd" , "db");
$stmt = OCIParse($conn,"select * from table order by name");
OCIExecute($stmt);
print("<TABLE BORDER=1>\n");
print ("<TR ALIGN=LEFT VALIGN=TOP>");
$cols = OCINumCols($stmt);
for ( $i = 1; $i <= $cols; $i++ ) {
$column_name = OCIColumnName($stmt,$i); print ("<TH>" . $column_name . "</TH>\n"); } while ( OCIFetch($stmt) ) { print ("<TR ALIGN=LEFT VALIGN=TOP>"); $ncols = OCINumCols($stmt); for ( $i = 1; $i <= $ncols; $i++ ) { $column_value = OCIResult($stmt,$i); print ("<TD>" . $column_value . "</TD>\n"); } }
It works fine in windows and not for an unix server. uppercase , lowercase , i try it out....but it won't help.
this error typically means your cursor is no longer valid, usually due to a commit before fetching all rows (i.e., within the loop) ==> where is the commit before fetching all rows ???????????????
"mcstock" <mcstock_at_enquery.com> schreef in bericht news:acadnQO8p4KNtTyiRVn-ug_at_comcast.com...
> did you look up the error in the reference manual? > > this error typically means your cursor is no longer valid, usually due toa
> commit before fetching all rows (i.e., within the loop) > > -- mcs > > "search" <gerry_at_village.uunet.be> wrote in message > news:3fa11465$0$20506$ba620e4c_at_reader1.news.skynet.be... > > Hi there , > > > > see code below : > > > > $conn = OCILogon("user", "pwd" , "DB"); > > $stmt = OCIParse($conn,"select * from tabel"); > > OCIExecute($stmt); > > while ( OCIFetch($stmt) ) { > > .........................................} > > > > I wanted to see a simple oracle table on my webpage.... > > > > If I use this code for an oracle table hosted on an windows server, it > works > > fine. > > > > If I use this code for an oracle table hosted on a unix server , then > > I receive : ORA-01002: fetch out of sequence . > > However the select is working via sql-net. > > > > I 'm using apache service included with oracle 9.2. > > > > > > What can be going wrong ? > > > > > > Gerry > > > > > >Received on Thu Oct 30 2003 - 09:41:02 CST