Deleting all rows from a database table.

Malky

Active Member
Licensed User
Longtime User
I seem to have this problem with only one table (so far).

If I want to update tables I use the DELETE * from tablename which has always worked before. (Sometimes at the wrong time, but we learn!)

I get an error with one table for some reason?

Has anyone experienced this? I pulled the table onto the computer and tried the same thing with sqllite and it locks up? I did try DELETE & from 'tablename' and DELETE * from tablename where 1 and many variations, but nope!

Cheers.

Malky
 

Malky

Active Member
Licensed User
Longtime User
It uses httpUtils2Service & httpjob.

May also need the images files, (attached)? I thought it would add stuff like this when I zipped it?

Cheers,

Malky
 

Attachments

  • back.png
    12.1 KB · Views: 292
  • home.png
    13.7 KB · Views: 279
Last edited:
Upvote 0

sorex

Expert
Licensed User
Longtime User
ok, now it runs but when I press english it nags that it can't find menu_phone.png and that's not one of the above 2

maybe it's better to join irc instead of flooding this thread?

http://jonsap.com/b4achat/
 
Last edited:
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Ok, attached, jeez.

I've added any possible others I think?

As I said, I though it zipped everything I needed.

Many thanks for your patience

Malky
 

Attachments

  • menu_phone.png
    8.7 KB · Views: 303
  • menu_eraser.png
    1.8 KB · Views: 301
  • menu_cancel.png
    7.4 KB · Views: 291
  • menu_email.png
    7 KB · Views: 269
  • menu_sms.png
    5.7 KB · Views: 308
  • menu_up_arrow.png
    1.6 KB · Views: 279
Upvote 0

sorex

Expert
Licensed User
Longtime User
I'm missing a menu_globe.png file here

also when I ran the app one time, the second time I just get an empty screen?
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Sorry, hope this is the last one. Also having probs with a new phone here, so not a good night.

Malky
 

Attachments

  • menu_globe.png
    7.8 KB · Views: 322
Upvote 0

sorex

Expert
Licensed User
Longtime User
I copied one of the other to menu_globe.png and now I get a menu after clicking english as language.

Do I just need to press update to see the issue?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
ok, solved it.

use it like this...


B4X:
Sub CreateMenuTable
   Log("menu table created")
   If Started = 0 AND LanguageSelected = 0 Then
      SQL1.ExecNonQuery("CREATE TABLE menus (id INTEGER, en TEXT, ru TEXT, bg TEXT, gr TEXT, icon TEXT)")
    End If
   If Started = 0 AND LanguageSelected = 1 Then
      SQL1.ExecNonQuery("DELETE FROM menus")
      SQL1.TransactionSuccessful  ' <- !!!!!!!!!!
   End If
End Sub
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Cheers, Sorex, although I am getting a problem which I think is due to the fact that I update all the tables at once and the TransactionSuccessful call should only be called once they are done I believe?

Will report back, getting late for me here as well.

Many thanks so far,

Malky
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Well, I'm back and it appears to work at damn last!!!!!!

I changed the text on the live server and it updates, so it is working and I owe it all to Sorex.

If you don't do anything else in your life, just smile and remember you've made me very happy ))))

On with the rest of the stuff, but work tomorrow, so the timing was even perfect.

A very Happy Malky
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I update all the tables at once and the TransactionSuccessful call should only be called once they are done I believe?

for the updating that's right, or you could acknowledge it after every query.

but in this case the delete had to be executed first before you start inserting stuff again.

have fun with the rest of the code.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…