0

I have a database object called objdb. From this object it seems that I can only execute one sql query at a time. if I insert a semi-colon in the end,it gives me a

ORA-0911 invalid character error.

For example, if I run

objdb.executeSQl("select * from table1; select * from table2")

This gives me a error.

How can I run multiple queries from a single ExecuteSQl method ?

user692942
  • 16,398
  • 7
  • 76
  • 175
Raxak
  • 389
  • 3
  • 17
  • You cannot run two SQL statement at once in that way. Execute it twice. For exmaple:http://stackoverflow.com/questions/1103804/how-to-execute-an-oracle-sql-statements-with-vbscript – atokpas Nov 25 '16 at 05:29
  • Yeah. I thought so too. Is there any alternative way to do so? Run multiple queries at once? – Raxak Nov 25 '16 at 05:37
  • Why would you like to do that? You want the joint result from these two tables? Otherwise if you want the separate result then prepare two statements and execute one after another. – atokpas Nov 25 '16 at 05:42
  • No. Actually, what I was working on was, I have to parse a CSV and create a query for each csv line. So , instead of opening up a new connection and then running a query per CSV line and closing the connection and doing it all over again which I think will slow down the server, I am trying to create a long query by parsing the whole csv all at once and then then open a connection, run that long query once and then close the connection. In this way I am thinking I can avoid opening and closing the database object multiple times. – Raxak Nov 25 '16 at 06:36

0 Answers0