On Wed, May 19, 2010 at 02:49:05PM +0200, Raoul scratched on the wall: > Hi Simon, > > Thanks for your answer, I suppose by ", ..." in the create table command you > mean that I should explicitly specifying each column, which is exactly what > I didn't want to do in the first place. > > By your response I guess that there is no other way of doing it then....
If you want to control the affinities and constraints of a table (like the PK definition), you must use CREATE TABLE. It's that simple. If you need to do this for arbitrary table definitions, you can extract the CREATE TABLE statement for your original table from the sqlite_master table. All you need to do is change the table name. > Well I will test and decide which method from yours or the copy method from > the sqlite website suit me the best. They're the same method. Notice the fifth and sixth line from the FAQ: CREATE TABLE t1(a,b); INSERT INTO t1 SELECT a,b FROM t1_backup; > > CREATE TABLE My_second_tbl( qid integer primary key, ... ); > > INSERT INTO My_second_tb SELECT * FROM My_main_tbl WHERE topic = ‘aviation’; -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go home and see if I can scrounge up a ruler and a piece of string." --from Anathem by Neal Stephenson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users