Linker IT Software
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Run multiple SQL queries together (Read 7395 times)
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
Run multiple SQL queries together
09.01.06 at 10:09:03
Jorma from Finland asked the following question:
Can several SQL queries be packed to one RunQuery to speed access? The queries must locate the results to different locations, therefore separate.
Yes you can run multiple SQL statements. You can actually mix any statement type so it would work not only for SQL queries.
In SQL*XL's SQL dialog, type more than one statement. End each statement with a semi colon ;
E.g. you could enter and run:
select * from emp;
select * from dept;
select * from salgrade;

However you can also mix statement types and run:
column empno format 0000000;
select * from emp;
accept myempno prompt 'Enter employee to give a pay rise:';
update emp set sal = sal * 1.1 where empno = &myempno;
select * from emp;

If you run more than one select statement the results will be separated in the spreadsheet with a blank row. If you want to predefine where the results should be put (you can then use the Ok All button to not have to give options for each statement) you can use the to clause. Example:
select * from emp to A1;
select * from dept to Sheet2!D12;
Back to top
« Last Edit: 09.01.06 at 10:16:58 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1