use seqname.nextval in your insert statement
insert into table
  (id,
   ..
   ..
  ) values (

   :seqname.nextval,

   ..
   ..
  )
or SELECT seqname.NEXTVAL into :id from sysdba.dual;

Jenny
On Friday 22 February 2002 04:10 am, you wrote:
> I have a dbproc that among other things inserts a new row into a table
> with an id generated from a sequence.
>
> Now I do:
>
> select owner.seqname.nextval from table;
> fetch first into :id;
>
> insert into table
>  (id,
>   ..
>   ..
>  ) values (
>
>   :id,
>
>   ..
>   ..
>  )
>
> ID is declared out, of course.
>
> In Interbase, you can user id = gen_id(seqname, step) in stored procs. Is
> something like this possible in sap? It is more convenient and the method
> I use now seems like a quick hack. :)
>
> Regards,
>
> Dag Liodden
>
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to