Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / September 2004

Tip: Looking for answers? Try searching our database.

serial equivalent in DB2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Techie - 29 Sep 2004 22:17 GMT
If I want to create a table with a triggter to retrive data fast in DB2
database, how can I do that?
I know in informix we have serial as a data type. what is the equivalent in
DB2? what is the sql syntax of defining a column as the serial equivalent in
DB2?

Thanks
Madison Pruet - 30 Sep 2004 03:29 GMT
DB2 has the sequence data type, which provides much of the functionality of
the IDS serial.

You can automatically populate the serial column (I think) by using the
serial_name.nextval as the default value for the column.  Someone correct me
if I'm wrong about this.

M.P.

> If I want to create a table with a triggter to retrive data fast in DB2
> database, how can I do that?
[quoted text clipped - 3 lines]
>
> Thanks
Ian - 30 Sep 2004 06:27 GMT
> DB2 has the sequence data type, which provides much of the functionality of
> the IDS serial.
>
> You can automatically populate the serial column (I think) by using the
> serial_name.nextval as the default value for the column.  Someone correct me
> if I'm wrong about this.

IDENTITY is closer to serial (at least that's what we implemented in an
IDS -> DB2 migration).

A sequence isn't a data type, it's an object (that is independent of a
table).
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.