Re: rowid (faking)
Posted in 1994
> > I am having trouble accessing the rowid colum using
> MS ODBC and visionware's alternative to INET.
> > How would I povide a fake rowid column eg called recordnum.
> I want each row to have a unique id (eg an int) so that I can
> use it in select statements. > > I obviously specify UNIQUE? but how do
I automatically create new
> recordnums. Do I declare that column as SERIAL as well?
> > Please email replies as I may miss any posted. > > Thanks for your
time.
> Alex McLintock [also alex@arcfan.demon.co.uk]
>
Define it as SERIAL. That way each time you insert into the prog an
assign it a value of zero, the next available number gets allocated to it.
If you create the table through ISED (ie. the table editor with isql /
dbaccess) it adds a unique index for you, if you use a CREATE TABLE
script you have to add the index (or constraint) yourself. (A unique
constraint, or a primary key for that matter, cause an index to be
generated automatically.)
> ("How's Anny?" - Special Agent Dale Cooper)
akent@cix.compulink.co.uk (Andy Kent)
-------------------------------------