Another Sqlite Blog
by Frank Carney · 12/24/2007 (7:07 am) · 1 comments
I finally picked up where I left off last September and messed with writing sqlite functions. I made some great strides in figuring out how to copy a table and changing a field name in the process. It is a pain to do, but it was not too bad. Basically I had to use a combination of "pragma" statements to get column information and copy the data except for the rows that do not match. I cannot understand why sqlite would care if I copied data from one row to another of a different name. Either that or it does not understand my intentions. If anyone understands how to copy something like this:
How do I get sqlite to copy the data from c to p? I ended up ignoring that field as it is an PRIMARY KEY field. I ended up doing this:
I have developed a number of helper functions for creating databases, creating game specific tables, etc. My next step is to actually produce a dynamic mission from this information. Hopefully I can get something working in the next few days. Alas the holidays are upon me and that time may be spoken for.
Also, I uncovered a couple of bugs in the sqliteobject code. I put those changes in the following resource page:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7281
Merry Christmas everyone!!!
May God bless you.
INSERT INTO table2(p,a,b) SELECT c,a,b FROM table1This code failed with type miss match messages.
How do I get sqlite to copy the data from c to p? I ended up ignoring that field as it is an PRIMARY KEY field. I ended up doing this:
INSERT INTO table2(a,b) SELECT a,b FROM table1I figured it would generate the necessary values on its own.
I have developed a number of helper functions for creating databases, creating game specific tables, etc. My next step is to actually produce a dynamic mission from this information. Hopefully I can get something working in the next few days. Alas the holidays are upon me and that time may be spoken for.
Also, I uncovered a couple of bugs in the sqliteobject code. I put those changes in the following resource page:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7281
Merry Christmas everyone!!!
May God bless you.
About the author
Torque Owner Frank Carney
Messing with sqlite definitely is fun. I used to think database stuff was really boring. It is actually very interesting.