Page 1 of 1

I need obtain the value from a sequence in Oracle8i

Posted: Tue Jan 21, 2003 3:04 am
by skull cowboy
Hi all,

I need obtain a value from a sequence in Oracle 8i, Could someone show me a source code in PHP for that?

I try to do that with the next source code, but it's not run corretly:

$c1=ocilogon("username","password","sid");
$sql="select name.NEXTVAL FROM table";
$stmt=ociparse($c1,$sql);
ociexecute($stmt,OCI_DEFAULT);
print OCIResult($stmt,"name");

If someone cam help me, please send me a e-mail with the solution to
tiridium@hotmail.com because i only can consult this e-mail address.

Thanks in advance.

Bye.

Posted: Tue Jan 21, 2003 8:50 am
by hedge
You just need to give it an alias

ie select seqname.nextval newseq from dual;

then get the column named newseq.