Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How to convert "Begin Atomic" in Sybase to Oracle !!!
First a little side note: this really is off topic in ...oracle.marketplace, so I also cross-posted to com.databases.oracle.misc
You can assign the ID using a sequence and a trigger on insert to that table. Then this procedure will remain relatively the same.
If you are assumimg the MAX(ID) is the ID of the row inserted here, you might be better off doing as Mike Shoop suggested and adding the Sequence value to the INSERT in this routine.
Ed Prochak
CME wrote:
>
> HI:
>
> Would you like to tell me how i can convert the following case in Sybase
> format to Oracle?
>
> ---------------------------------------------------------------
> create or replace procedure
> bbc.AddNewIdentInformed(sDateDone in date,sPerson in long,sDoneBy in
> long,sNotes in long,sIdentID in number,sID out number)
> begin atomic
> insert into IdentInformed(IdentID,DateDone,Person,DoneBy,Notes) values(
> sIdentID,sDateDone,sPerson,sDoneBy,sNotes);
> select MAX(ID) into sID from IdentInformed;
> end;
> /
> -------------------------------------------------------------
>
> Thanks!
Received on Fri Jul 20 2001 - 09:38:27 CDT