Identity column in Oracle 
Author Message
 Identity column in Oracle

Can I get the same functionality with SQLServer's Identity columns
in ORACLE. I don't mean Sequence objects. I need the column to auto
increment in every insert without me having to specify
the column in Insert statements.

Thanks in advance

Strider.



Sat, 29 Nov 2003 21:03:45 GMT  
 Identity column in Oracle
As far as I know, Oracle has no built-in support for this kind of stuff
apart from sequences, but I think that you can use a trigger to insert the
value automatically (other issue is retrieving the value if you need it for
subsequent actions).

--
Best regards,

Carlos J. Quintero

MZ-Tools 2.0 freeware 'all-in-one' Add-In for VB6: Task List, Line
Numbering, TabIndex Assistant, Procedure Callers, Find and Replace in All
Projects, Close Windows, Review TabIndex and Collections, Add Procedure, Add
Error Handler, Add Procedure or Module Header, Clear Immediate Window,
Statistics, Copy/Paste/Rename/Remove controls with code, Default Controls
Properties and more:
www.mztools.com



Quote:
> Can I get the same functionality with SQLServer's Identity columns
> in ORACLE. I don't mean Sequence objects. I need the column to auto
> increment in every insert without me having to specify
> the column in Insert statements.

> Thanks in advance

> Strider.



Sun, 30 Nov 2003 00:06:20 GMT  
 Identity column in Oracle
Hello.

You can create a sequence and use that i a before insert trigger.

Example :
CREATE OR REPLACE TRIGGER MyTableName_trg
 BEFORE INSERT ON MyTableName
FOR EACH ROW
DECLARE
   tmpVar NUMBER;
BEGIN
   Select MySeq.NextVal into tmpVar from dual;
   :NEW.SequenceColumn := tmpVar;
END MyTableName_trg;

/Uffe

Quote:
-----Original Message-----

Can I get the same functionality with SQLServer's Identity columns
in ORACLE. I don't mean Sequence objects. I need the column to auto
increment in every insert without me having to specify
the column in Insert statements.

Thanks in advance

Strider.
.



Sun, 30 Nov 2003 04:05:46 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. SQL SERVER + IDENTITY column + DbSeeChanges PROBLEM

2. OpenRecordset and SQL Table w/ IDENTITY Column

3. Run time error 3622: OpenRecordSet: SQL server table: IDENTITY column

4. identity column (autonumber)

5. error 3622 - table has identity column

6. IDENTITY Column

7. RDO, SQL Server and IDENTITY columns

8. SQL Server/VB (Identity Column)

9. Please help - Error 3622 .... identity column

10. Identity column and Disconnected recordset

11. Get New Identity Column's Value

12. Reset Identity Column in SQL Server table with VB

 

 
Powered by phpBB® Forum Software