Create SQLite Tables
Posted: Mon Aug 24, 2015 4:25 pm
LiveCode 7.0.6
I can create 1 table in a SQLite Database but I can't seem to get LC to create a second table in the same databases.
I have tried the following with the create table combined and I have also use two separate lines and neither has succeeded in creating the images table. The Inventory table is created but not the second table.
put getDatabaseID() into tDatabaseID
put "CREATE TABLE Inventory(Description char(360), DatePurchased Date(10) , PurchasePrice Integer(10),Id INTEGER PRIMARY KEY AUTOINCREMENT); CREATE TABLE Images(Id INTEGER PRIMARY KEY AUTOINCREMENT, Image BLOB , InventoryId INTEGER FOREIGN KEY REFERENCES INVENTORY(Id))" into tSQL
revExecuteSQL tDatabaseID, tSQL
Thanks Stacy
I can create 1 table in a SQLite Database but I can't seem to get LC to create a second table in the same databases.
I have tried the following with the create table combined and I have also use two separate lines and neither has succeeded in creating the images table. The Inventory table is created but not the second table.
put getDatabaseID() into tDatabaseID
put "CREATE TABLE Inventory(Description char(360), DatePurchased Date(10) , PurchasePrice Integer(10),Id INTEGER PRIMARY KEY AUTOINCREMENT); CREATE TABLE Images(Id INTEGER PRIMARY KEY AUTOINCREMENT, Image BLOB , InventoryId INTEGER FOREIGN KEY REFERENCES INVENTORY(Id))" into tSQL
revExecuteSQL tDatabaseID, tSQL
Thanks Stacy