revDataFromQuery and SQL

Brian Yennie briany at qldlearning.com
Mon Dec 12 01:19:19 CST 2005


Adam,

I think the problem you are finding is that Rev is escaping your 
variable's contents for use in the SQL statement as part of the WHERE 
query. Instead of using the placeholder, you could just build the SQL 
completely yourself:

> put revDataFromQuery(,,myDB,"SELECT * FROM table LIMIT :1,1", 
> "myCount") into myResult

Becomes:

put revDataFromQuery(,,myDB,"SELECT * FROM table LIMIT "&myCount&",1") 
into myResult

HTH.

- Brian

> Hi All:
>
> Terribly frustrated at the moment.  I'm stepping through the code of 
> my stack and I have a call to revDataFromQuery that uses the following 
> SQL:
>
> put revDataFromQuery(,,myDB,"SELECT * FROM table LIMIT :1,1", 
> "myCount") into myResult
>
> What I want to be able to do is call up a specific row, limiting that 
> selection to one row.
>
> myCount contain the number of the row I want to call up.
> But I get a nasty SQL error.  Can you not put limit clauses into 
> revDataFromQuery statments?
>
> The reason I am doing all this is because I am looping through 
> millions of records and it is just to memory hungry to call all the 
> records into a record set, so I have loop set up that executes the 
> above statment and manipulates the myResult variable accordingly 
> before increasing myCount and starting the loop over.
>
> TVKIA,
> Adam
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>




More information about the use-livecode mailing list