|
-
--First create a table according to your requirements. e.g.,
CREATE TABLE Temp_Table
(ID number(6),
NAME varchar2(20));
--Then create a SEQUENCE that generates sequentially generated numbers starting with 100000. e.g.,
CREATE SEQUENCE SEQ_Temp_Table START WITH 100000 nocache
/
--Now create a FUNCTION which return the next value to be inserted into your table. e.g.,
CREATE FUNCTION Temp_Table_NEXT_ID RETURN NUMBER IS
X NUMBER;
BEGIN
SELECT SEQ_Temp_Table.NextVal INTO X FROM DUAL;
RETURN X;
END;
/
--Then INSERT your records. e.g.,
INSERT INTO Temp_Table Values
(Temp_Table_NEXT_ID , 'MYNAME');
I think this should work.
Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|