Subject Re: [firebird-support] Create table from another table
Author Martijn Tonies
> > What you're doing is assigning a meaning to an artificial generated
primary
> > key value.
> >
> > This, IMO, is bad design.
>
> Sorry for using PK, I can see that was confusing. Actually, it doesn't
> have to be a primary key, it is just about using trigger and generator

Right, I could have looked beyond that...

I still wonder if this is what the original poster wanted though.

> to get some kind of sequence. And when doing this, having INSERT INTO...
> SELECT FROM... ORDER BY... can be the quickest way to achieve this
> sequence (at least as long as UPDATE statements cannot ask for some kind
> of ORDER BY).
>
> Moreover, the tables I'm talking about are more or less temporary tables
> only of interest for further processing in creating a "flat table".

Processing the rows in a stored procedure could do the job.


> I agree that a primary key in normal tables should bear no meaning.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com