On Fri, May 11, 2007 at 20:43:46 +0200, Frank Pool wrote: > I want to create a table with two colums: > > One ist the primary key (test_num) > and the second column sholud contain the value of the primary key (maybe as > a string) by default. > How can I define this table in sql ? > > CREATE TABLE test_table ("test_num integer primary key AUTOINCREMENT NOT > NULL, test_name varchar(256) DEFAULT ??? NOT NULL,")
You can't do this with SQL. DEFAULT value is a constant, it is not re-evaluated on every insert. You may consider inserting the same value into both test_num and test_name columns explicitly, since the next value of AUTOINCREMENT column is predictable (and the largest used value may be learned from sqlite_sequence table). -- Tomash Brechko ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------