SQL Statement in Rev Wipes Out Table

Trevor DeVore lists at mangomultimedia.com
Mon Dec 12 13:51:15 EST 2005


On Dec 12, 2005, at 10:35 AM, Mark Wieder wrote:
> Monday, December 12, 2005, 5:12:46 AM, you wrote:
>
>> put revDataFromQuery(,,myDB,"SELECT COUNT(*) FROM myTable") into  
>> myCount
>
>> And I want to see the result by using:
>
>> answer myCount
>
>> Well I get zero (0).  The data in the table is gone after I  
>> execute that

Hmm, this works on my end.  I tested on OS X.4 running MySQL 4.1.   
Not sure why you are losing all of your data.  This seems really odd.

> Can't tell you why your data has gone missing, but...
>
> I don't think revDataFromQuery() is really what you want here. Try
>
> put revExecuteSQL(myDB, "SELECT COUNT(*) FROM myTable") into myCount
>
> or create a recordset and use revNumberOfRecords():
>
> revQueryDatabase(myRS, "SELECT * from myTable") into myRS
> put revNumberOfRecords(myRS) into myCount

revDataFromQuery should work correctly in this context since it will  
return the text of the result of the query which should be the number  
of records in the table.  revExecuteSQL won't return the value Adam  
is after since it just executes the sql, no SELECT statements allowed.


-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com





More information about the use-livecode mailing list