Page 1 of 1
SQLite not saving tables?
Posted: Fri Aug 26, 2011 6:36 pm
by Kaubs
I have created a stack that follows an example fairly closely on working with SQLite. It works perfectly every time on my mac or windows machine. The issue is that when I build to iOS the database is created with no problem in the documents folder but I cannot seem to save to the database. It doesn't create the tables I am telling it to. Is there something I am doing wrong? I use iPhone explorer to view the db on my computer and can see that no tables have been created.
Re: SQLite not saving tables?
Posted: Fri Aug 26, 2011 11:30 pm
by Kaubs
I think the issue was that when copying the database back to the computer it was stripping the databases settings and content. Seems to be working...I just cannot verify that it is visually.
Re: SQLite not saving tables?
Posted: Tue Aug 30, 2011 8:03 pm
by Kaubs
ok so the issue isn't that the tables are not being created its that I must not be using the proper syntax to inject data into the tables. Here is my code
Code: Select all
put "INSERT INTO 'main'.'production' (cname, pname, emailrto) " into tSQL
put "VALUES (" & tcompname & ", " & tprodname & ", " & tert & ");" after tSQL
revExecuteSQL conID, tSQL
answer warning the result
The error I get answers back "there is no column 'whatever I've put into the variable' ".
So here the table name is production and there are about 12 columns. Any ideas? thanks so much!
Re: SQLite not saving tables?
Posted: Tue Aug 30, 2011 9:31 pm
by Kaubs
Seems a little ridiculous...perhaps its the correct syntax and only way to do it tho.
this works
Code: Select all
put "INSERT INTO 'main'.'production' (cname, pname, emailrto) " into tSQL
put "VALUES (" &numtochar(39) & tcompname &numtochar(39) & ", " &numtochar(39) & tprodname &numtochar(39) & ", " &numtochar(39) & tert &numtochar(39) & ");" after tSQL
revExecuteSQL conID, tSQL
answer warning the result
is there any way to get around the double binary error without using numtochar(39) when trying to use "' &varialbe& '"???
Please let me know if I'm not being clear.