problem with query that contain : ' select xy from tbla where xy not in (select xyTbla from tblB ) '

hi xojo and rs crash when i make a query/code like this :

dim s as string
dim rs as string
dim db as mysqlcomm…

s=“select id from tblA where id not in ( select idTbla from tblB and dateX =‘2014-01-01’)”

ide crash and want to send feedback
the feedback case is n. 31650
can anyone help me ??

tbla has 1 field named ID
tblb has one filed named idTbla and 1 field named datex that is date is integer and tblb.idtbla is integer

Which database?

rs should be a RecordSet, not a String.

yes in the code it is recordset , i rewrite wrong the example
i try to edit the first conversation but i can’t

s=“select id from tblA where id not in ( select 8 from tblB WHERE id=idtbla and dateX =‘2014-01-01’)”

You forgot the WHERE statement, and need to better define what you are or are not looking for

and yes that is an “8” not an “*”… it keeps the db engine from build a data vector…which is a waste of time for this type of operation

Isn’t it just this?

s=“select id from tblA where id not in ( select idTbla from tblB where dateX =‘2014-01-01’)”

hi dave, but if i execute this query from sequel pro … this query work good… (the query is not wrong)
but if i execute this query (with db.sqlexecute) in xojo or realstudio ide … the ide crash … and not replyes with an error but crash and say if i would like send a feedback…

i have create a feedback case is n. 31650
ps. i’m using web edition

It crashed because you left out the keyword WHERE… perhaps SQLPro is more forgiving (but if so, it should not be)

sorry Dave, but ide crash because not intercept a potential error… or because there is an exception unmanaged by ide …
this is the function of feedback utility, send an unmanaged exception … (i think ) or not ??

Perhaps it crashed because the database engine crashed… not Xojo.
Xojo does not execute SQL… it passes it to the DB Engine and waits for an answer.

Syntax wise… .Xojo doesn’t care (or know for that matter). It sends the query as a string.
If the DB Engines reaction is to crash… .it takes Xojo down with it… if the DB Engine returns an error code to Xojo then Xojo will react to that.

But, if it’s reproducible, it should be reported via Feedback. I think Dave is more concerned with you avoiding the crash so you can get your app done.