Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
auto incremental column for table
Opeth
Hi all,
Is there anybody who knows how to create an auto-increment column as a primary key in database table through a dbschema?This column won't take any value from the DCR , it will generate an unique Id for each record and will be use as primary key for the table.
any advise will be appriciated.
Find more posts tagged with
Comments
Bill Klish
What version of OD are you using?
If it is a recent one, you can just use the ExternalDataSource java interface for this. Look in the DD manual under Advanced Features. Sample code is included underneath your od-home directory.
Hope that gets you started,
-Bill
Opeth
I am using 6.0.2 . Is there any other way that i can generate unique id in dbschema for a column in a table?
Bill Klish
Well, assuming you are deploying TeamSite DCRs, you could put some Form API code in your template to auto-generate these ids using the call server framework, or by writing an inline script to hit your database and grab the next sequence.
The external data source route is fairly simple and straightforward. It probably is the fastest executing as well. (in my opinion).
-Bill