Proper use of revExecuteSQL for making queries
Posted: Sun Jul 01, 2012 10:37 pm
Hello everyone,
I know it is possible to use the function getDataFromQuery to get the records from a database directly into a variable (I've already done that). Now I would like to do the same but using the command revExecuteSQL. Is it possible to execute a query using the mentioned command? I have tried but without any results. This is what I have:
According to the documentation:
My questions are:
1.Would the result of an actual query statement be 0?
2. Is it possible to use this command to get something like a cursor or set of results?
3. Do you know a way to get the results of a query as a cursor or a record set?
Thank you very much,
Octavio.
I know it is possible to use the function getDataFromQuery to get the records from a database directly into a variable (I've already done that). Now I would like to do the same but using the command revExecuteSQL. Is it possible to execute a query using the mentioned command? I have tried but without any results. This is what I have:
Code: Select all
function databaseGetCountries
put getDatabaseID() into tDatabaseID
put "SELECT Country_German FROM country_info" into tSQL
revExecuteSQL(tDatabaseID,tSQL)
answer the result with "OK"
end databaseGetCountries
I want to make sure that I correctly understood what is stated in the documentation: by 'query' they are referring to any SQL statements.The revExecuteSQL command places a return value into the result, to indicate the outcome of the query. For successful queries, the revExecuteSQL command returns the number of rows affected for INSERT, UPDATE and DELETE statements. For all other statements, 0 is returned. For unsuccessful queries, an error string is returned, describing the problem.
My questions are:
1.Would the result of an actual query statement be 0?
2. Is it possible to use this command to get something like a cursor or set of results?
3. Do you know a way to get the results of a query as a cursor or a record set?
Thank you very much,
Octavio.