Crash

Ivan Smahin ivan_smahin at paradigmasoft.com
Mon Aug 3 01:41:09 CDT 2015


Hi Mark,

> On Aug 3, 2015, at 2:38 AM, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:
> 
> Hi,
> 
> I have the following (slightly abbreviated) LiveCode script:
> 
> put "SELECT * FROM table1" into mySQL
> put vDatabase_SqlQuery(gID,mySQL) into myCursor
> put vCursor_recordCount(myCursor) into myRecordCount
> put vCursor_getRecord(myCursor,tab,cr) into myData
> 
> The above script crashes LiveCode and myRecordCount contains the number 2 instead of the expected number of 35 records. It works fine if I replace vDatabase_sqlQuery() with vDatabase_sqlSelect().
> Is this a bug? Do I do something wrong here? Is vDatabase_SqlQuery() deprecated?
> 

But vDatabase_SqlQuery returns VQueryResult - not VCursor.
Then, based on VQueryResult_Type you should get either cursor or "affected row count" value.
So it must be something like this one:

...
dim queryResult as VQueryResult
put vDatabase_SqlQuery( gID, mySQL ) into queryResult
-- if queryResult is cursor type
put VQueryResult_Cursor( queryResult ) into myCursor
...

-- 
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list