Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sql syntax help
You could also use a trigger on database server to do this job. This
trigger
also locks the row so that no one else updates which your trans is
still not
committed.
SQL> EXEC S2.BLDSEQ('SEQ_DEPTNO', 'TABLE', 'DEPT', 'DEPTNO')
| ----------------------------------------------------------------------
regards,
M. Armaghan Saqib
+---------------------------------------------------------------| 2. SQL Link for XL => Integrate Oracle with XL
| 1. SQL PlusPlus => Add power to SQL Plus command line
+---------------------------------------------------------------
+---------------------------------------------------------------
Ashwath Kakhandiki <ashwath_at_bluedog.com> wrote in message news:sd5e13gtfja96_at_corp.supernews.com...
> Hi everyone, > > I have two SQL query statements like this: > > SELECT ID FROM ID_TABLE > > set variable id = ID in Java code > > UPDATE ID_TABLE SET ID= "+ (id+1) + " WHERE ID=" + (id); > > Is there a safe way to do this so that it will succeed > > for all callers? It is supposed to return a unique, > > increasing number every time it's called.
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Mar 20 2000 - 00:00:00 CST