Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oracle sql how to do asynchronous queries

I have multiple select queries which I want to execute asynchronously. How can I do this in oracle sql ?

I basically want to test something and so want to simulate workload so I don't really care about the result and I know I can do this in multiple threads but this is specific and so would prefer if I can do this entirely in sql. procedures are fine though. NOTE: there are no update queries only select.

I read about nowait but am not sure how to use it in oracle.

I tried something like -

select * from foo with(nowait) where col1="something";

This is the error I got -

with(nowait)
*
ERROR at line 3:
ORA-00933: SQL command not properly ended
like image 847
L Lawliet Avatar asked Aug 09 '26 01:08

L Lawliet


1 Answers

The Oracle info on NOWAIT says:

Specify NOWAIT if you want the database to return control to you immediately if the specified table, partition, or table subpartition is already locked by another user. In this case, the database returns a message indicating that the table, partition, or subpartition is already locked by another user.

This will not do what you want.

Asynchronous queries are an application thing, not a SQL thing. For example I can open TOAD and open a dozen windows and run long queries in all of them and still open another window and run another query. I could open a dozen instances of SQLPLUS and do the same thing. Nothing in the query lets me do this, it's in the application.

like image 88
Nick.McDermaid Avatar answered Aug 10 '26 14:08

Nick.McDermaid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!