SQLite not saving tables?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

SQLite not saving tables?

Post by Kaubs » Fri Aug 26, 2011 6:36 pm

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.

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: SQLite not saving tables?

Post by Kaubs » Fri Aug 26, 2011 11:30 pm

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.

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: SQLite not saving tables?

Post by Kaubs » Tue Aug 30, 2011 8:03 pm

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!

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: SQLite not saving tables?

Post by Kaubs » Tue Aug 30, 2011 9:31 pm

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.

Post Reply