I need some help. I started this app using LiveCode and SQLite and I've since switched over to Xcode and SQLit.Swift. I'm using the existing database. I'm having a little trouble converting an inner join of some of the tables.
Right now I'm dealing with 3 tables:
CrossRef, My_Data and My_Routines
My_Data contains DataID and Data_Name and My_Routines contain RoutineID and Routine_Name.
The CrossRef table was created like this. It only has 2 fields, DataID and RoutineID
I'm trying to re-wright the following line so I can use it with SQLite.Swift. I've included the Expressions for the table and the fields.
SELECT My_Data.Data_Name FROM CrossRef INNER JOIN My_Data USING (DataID) WHERE CrossRef.RoutineID = gRoutineID
let crossRefTable = Table("CrossRef")
let crossRefRoutineID = Expression<Int64>("RoutineID")
let crossRefDataID = Expression<Int64>("DataID")
let theDataTable = Table("My_Data")
let dataID = Expression<Int64>("DataID")
let data_Name = Expression<String>("Data_Name")
let theRoutineTable = Table("My_Routines")
let routineID = Expression<Int64>("RoutineID")`
I've read through the SQLite.Swift documentation online but I'm afraid it's not helping me much.
I need some help. I started this app using LiveCode and SQLite and I've since switched over to Xcode and SQLit.Swift. I'm using the existing database. I'm having a little trouble converting an inner join of some of the tables.
Right now I'm dealing with 3 tables: CrossRef, My_Data and My_Routines
My_Data contains DataID and Data_Name and My_Routines contain RoutineID and Routine_Name.
The CrossRef table was created like this. It only has 2 fields, DataID and RoutineID
CREATE TABLE "CrossRef" ("DataID INTEGER NOT NULL, "RoutineID" INTEGER NOT NULL, FOREIGN KEY("RoutineID") REFERENCES "My_Routines", PRIMARY KEY("DataID","RoutineID"), FOREIGN KEY("DataID") REFERENCES "My_Data"
I'm trying to re-wright the following line so I can use it with SQLite.Swift. I've included the Expressions for the table and the fields.
I've read through the SQLite.Swift documentation online but I'm afraid it's not helping me much.
Any help would be appreciated.
Thanks, Tom