Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


ID: 27561, Implementing Auto-Increment/Identity in Oracle

by Oktay Amiry Email: Anonymous


Macro to generate sequence and trigger for Oracle to implement a feature similar to auto-increment/identity in MS SQL Server and other databases.
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For ER/Studio Data Architect, Version 8.5  to 8.5 105 downloads
Copyright: No significant restrictions


Size: 881 bytes
Updated on Fri, 15 Jan 2010 11:58:57 GMT
Originally uploaded on Fri, 15 Jan 2010 11:58:57 GMT
SHA1 Hash: B17E73A685AF9777FD3CCFADFFB0503BF47BCF0E
MD5 Hash: 85F049737A83E023632C9BF0AD6E4158

    Explore the files in this upload

Description
ER/Studio uses and generates code for identity property if the target platform supports the notion of identity or auto-increment field such as Microsoft SQL Server. In Oracle 10g there is no identity property that can be assigned to a column. Rather, a user must define the necessary sequence and triggers to populate the content of the desired field with value. ER/Studio does not generate such customized code. However, one can write a macro for example that creates the sequences and triggers. Attached is a sample macro that basically performs this task. Please open your diagram, ensure that you have specified the identity property in the logical model, select an Oracle physical model, select the "Macros" tab page in the explorer, and right-click on this macro and select to run the macro. The macro creates a sequence for each table named: table name + "_SEQ". It also creates a trigger named table name + "_BI_TRG". You can edit this macro to change this naming convention to suit your needs.

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Server Response from: ETNACDC03