On Wed, 13 Feb 2002, Stacy Mader wrote:

> #!/usr/local/bin/perl
>
> use strict;
>
> my $sql = q{
>   INSERT INTO REPORT
>     VALUES (REPORT_NUM_SEQ.NEXTVAL,?,to_date(?,'DD-MON-YYYY HH24:MI')
>          ),
>       undef, $report, $date_reported
>     };
>
> Where the report number is incremented via the
> REPORT_NUM_SEQ.NEXTVAL statement (REPORT_NUM_SEQ
> is an Oracle sequence).

Can't you do a query and retrieve REPORT_NUM_SEQ.CURRVAL (something like
SELECT REPORT_NUM_SEQ.CURRVAL) after you do the insert?  That should be
the value that was just inserted from the sequence (going by my rusty
Oracle knowledge -- I remember that it was very similar to PostgreSQL's
sequences, where you would do currval('report_num_seq')).

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
He who invents adages for others to peruse
takes along rowboat when going on cruise.

Reply via email to