Sure. Bare in mind that the sequence and the table are two separated
objects.
The way to "bind" them is via trigger:
CREATE OR REPLACE TRIGGER tbl_before_insert_tg ...
.
.
BEGIN
:new.col_id:= <sequence_name>.NEXTVAL;
END tbl_before_insert_tg;
-----Original Message-----
From: luis
[mailto:oracledba-ezmlmshield-x99462741.[Email address protected]
Sent: Wednesday, May 31, 2006 2:19 PM
To: LazyDBA Discussion
Subject: Concept of a sequence
G's
I will try and make sense, but cannot guarantee it.
I want to have a unique incremental indentifier on records being
inserted.
For every insersion there should be a column with this indentifier and
as a record is inserted this sequence to kick in and insert the it's
value into the table.
How can I relate a sequence to a table?
Am I going about it the right way?
Thanks,
Luis
This communication is intended for the addressee(s) only.
Please notify the sender if received in error. Internet email is not to
be treated as a secure means of communication.
Cheshire Constabulary monitors all Internet and email activity and
requires it is used for official communications only. Thank you for your
co-operation.
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com By using this list you agree
to these terms:http://www.lazydba.com/legal.html
--
This message has been scanned for viruses and
dangerous content by OpenGaming Security System and is
believed to be clean.
Have a nice day,
This e-mail and any attachments may contain information that is confidential, proprietary, privileged or otherwise protected by law. The information contained herein is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.
Oracle LazyDBA home page