Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asynchronous query execution from my ODBC app 1

Status
Not open for further replies.

CBU64

IS-IT--Management
Apr 30, 2001
19
MX
Hi everybody,

Don't know if someone has experience about the following matter: I'm programming an ODBC client app, based on Visual FoxPro 6.0 as frontend, and mySQL 4.1.13-nt (running under Windows 2003 Server) as my RDBMS backend.

I want to know if there is a way on which I can execute a long query on mySQL without locking my Visual FoxPro app. On VFP, there's a way to establish it, using SQLSetProperties function, by setting a parameter to asynchronous as true or false.

Perhaps, this function ONLY works with MS products (i.e. MS SQLServer), cause I have explored it previously with this RDBMS, but 'til now, mySQL locks my app until the record set is returned.

Any idea? BTW: the statement I'm execute is a create table based on large select.

Thanks in advance

Take away all the buzz of this biz and what do you get? 01000100101010...
 
You can run a SQL query (or any other process) in the background by using threading techniques in your program; this depends on the facilities available in the programming environment that you use.

Another option would be to use the OS shell (in Windows, the "start" command) to run the query in the background; if this query was set up to write its (possibly null) output to a new file, your program could then check periodically for the existence of, and possibility to open, this file. For example (all on one line):[tt]
start c:\prog\mysql\bin\mysql dbname
-e "create table t as select * from tbl"
>c:\temp\34vv4b1b.tmp[/tt]
In the case of a query which returns a result set, you can then use text-processing techniques to read the file which was created.
 
Thanks for your approach, Tony.

Actually, I don´t care about its output: it all goes to a new table on mySQL, preparing a temporal table (something like a cursor) for further requests.

I'll give it a try and keep you informed about.


Take away all the buzz of this biz and what do you get? 01000100101010...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top