Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Returning Sequence Numbers In VB

Re: Returning Sequence Numbers In VB

From: Mark Wagoner <mwagoner_at_iac.net>
Date: Tue, 9 Jan 2001 16:13:16 -0500
Message-ID: <93futc$1fu8$1@genma.iac.net>

Hi Ben,

I haven't tried this with ADO but I think it should still work (I have always used OO4O). Try a statement like:

insert into table t (c1,c2,c3) values (seq.nextval, 'aaa', 'bbb') returning c1 into ?;

This works in OO4O (except you use :var instead of ? for bind parameters). I would think it should work in ADO.

"Ben Ralph" <ben_at_ralph.demon.co.uk> wrote in message news:979073676.26240.0.nnrp-01.c2de4ac6_at_news.demon.co.uk...
> Yes I am using 8i. I put a returning line in my SQL string but VB didn't
> pick up the return value. Do you have an example of the code? If it
 makes
> a difference I'm using ADO.
>
>
> "Mark Wagoner" <mwagoner_at_iac.net> wrote in message
> news:93f63m$v5t$1_at_genma.iac.net...
> If you are using 8i, you could also use INSERT INTO ... RETURNING ... with
 a
> bind variable to get the value back.
>
> "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message
> news:93d6s1$9po6u$1_at_ID-62141.news.dfncis.de...
> > Wrap the call to the sequence in a stored procedure and call the stored
> > procedure before insert of the record, or better still : leave the
 sequence
> > generation to an Oracle before insert trigger.
> >
> > Hth,
> >
> > Sybrand Bakker, Oracle DBA
> >
> > "Ben Ralph" <ben_at_ralph.demon.co.uk> wrote in message
> > news:978982105.18343.0.nnrp-10.c2de4ac6_at_news.demon.co.uk...
> > > When writing a new record to an Oracle table how can I have the
 sequence
> > > number returned to my VB app.
> > >
> > > --
> > > Ben Ralph
> > > MCP
> > >
> > >
> >
> >
>
>
>
>
Received on Tue Jan 09 2001 - 15:13:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US