ExecuteScalar with Oracle

S

Stan SR

Hi,

I m trying to get the last added sequence from an Oracle table with
executeScalar, but it seems I m doing something wrong.
Here's my query (that I use with commandType.Text (not a storeproc).

DECLARE curval number;
BEGIN INSERT INTO UTILISATEUR_GADGET
(uiduser,instance,couleur,gadget,idpage,colonne,ligne,param,dateupdate)
values ('B020964','',0,'feedrss.htm',4,2,0,'',TO_TIMESTAMP('22/02/2008
07:42:40','DD/MM/YYYY HH24:MI:SS'));
select UTILISATEUR_GADGET_SEQ.currval into curval from DUAL; END;

But I always get back a 0 as value (the record is added)

Any help ?

Stan
 
H

Hans Kesting

Stan SR explained on 22-2-2008 :
Hi,

I m trying to get the last added sequence from an Oracle table with
executeScalar, but it seems I m doing something wrong.
Here's my query (that I use with commandType.Text (not a storeproc).

DECLARE curval number;
BEGIN INSERT INTO UTILISATEUR_GADGET
(uiduser,instance,couleur,gadget,idpage,colonne,ligne,param,dateupdate)
values ('B020964','',0,'feedrss.htm',4,2,0,'',TO_TIMESTAMP('22/02/2008
07:42:40','DD/MM/YYYY HH24:MI:SS'));
select UTILISATEUR_GADGET_SEQ.currval into curval from DUAL; END;

But I always get back a 0 as value (the record is added)

Any help ?

Stan

In the code you show I don't see where you get the "next" value from
that sequence. So could it be that the value 0 is correct for the code?

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top