Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Nov 14, 2018 10:05 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Confused about delete query
PostPosted: Fri Jan 25, 2013 8:17 pm 
Offline

Joined: Fri Sep 14, 2007 5:00 pm
Posts: 408
Back again... this time with a delete query question.

Okay so if I use this: DELETE * FROM tblExportStore in an SQLite database it deletes all the contents of the table. Which is what I want. So when I try THIS in REALStudio: Dim recSet As RecordSet = dbTrnd.SQLSelect("DELETE * FROM tblExportStore") it doesn't work and no errors are thrown.

Now if I do something like this...

If(recSet) <> Nil Then
While NOT recSet.EOF
recSet.DeleteRecord

recSet.MoveNext

Wend

dbFaserBase.Commit
recSet.Close

End If


It works fine... how come my first way doesn't work?


Top
 Profile  
Reply with quote  
 Post subject: Re: Confused about delete query
PostPosted: Fri Jan 25, 2013 9:02 pm 
Offline
User avatar

Joined: Sun Jan 25, 2009 5:11 pm
Posts: 576
Location: Guatemala, Central America
McDian wrote:
Back again... this time with a delete query question.

Okay so if I use this: DELETE * FROM tblExportStore in an SQLite database it deletes all the contents of the table. Which is what I want. So when I try THIS in REALStudio: Dim recSet As RecordSet = dbTrnd.SQLSelect("DELETE * FROM tblExportStore") it doesn't work and no errors are thrown.

Now if I do something like this...

If(recSet) <> Nil Then
While NOT recSet.EOF
recSet.DeleteRecord

recSet.MoveNext

Wend

dbFaserBase.Commit
recSet.Close

End If


It works fine... how come my first way doesn't work?


Have you tried db.sqlexecute(delete * from yourtablename) ?

_________________
Future RS guru.
Ride the world!


Top
 Profile  
Reply with quote  
 Post subject: Re: Confused about delete query
PostPosted: Fri Jan 25, 2013 9:25 pm 
Offline

Joined: Fri Sep 14, 2007 5:00 pm
Posts: 408
No, I didn't know about that. I'll try it! Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: Confused about delete query
PostPosted: Sat Jan 26, 2013 10:41 am 
Offline
User avatar

Joined: Sun Jan 25, 2009 5:11 pm
Posts: 576
Location: Guatemala, Central America
Of course I forgot to include the quotes :mrgreen:

_________________
Future RS guru.
Ride the world!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group