Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Generating unique values without triggers/sequences
Hi There,
I remember getting similarly difficult questions when I was studying at Uni (especially difficult after a session at the uni bar)
However, we weren't allows to ask for assistance and I had to work it out for myself :(
Richard
"D. Alvarado" <laredotornado_at_zipmail.com> wrote in message
news:9fe1f2ad.0207191324.672f59f2_at_posting.google.com...
> Hello,
> (oracle 8.1.7) Due to the seemingly ridiculous restrictions I've
> put on this problem, it may not be possible to do this, but here goes:
> I'm looking for a way (in an INSERT statement) to generate unique
> values for a column either of a numeric or VARCHAR type. If it was
> just numeric, this would be basically straightforward:
>
> MAX(NUMERIC_FIELD) + 1
>
> but writing a more generic version to accommodate VARCHAR is more
> complicated. I discovered "MAX" is supported on VARCHAR's, but sadly,
> "+ 1" is not, for obvious reasons.
>
> Any ideas would be greatly appreciated.
>
> Thanks, Dave A.
Received on Fri Jul 19 2002 - 19:30:43 CDT
![]() |
![]() |