Using two select statements in one SQL command (Oracle, Access, etc.)
-
With SQL Server 2000, I can execute the following SQL command: select * from table1 select * from table2 The output contains two record sets, one for each select statement. But if I do this with Oracle or MS Access (via ODBC connections), I got syntax errors. The question is, what is the correct way to execute a SQL command with two or more select statements? Is it supported by Oracle? Is there a way to get around it? Thanks. P.S. I know the problem is not with ODBC itself because I can do this with SQL Server 2000 via ODBC connection.[
My articles and software tools
-
With SQL Server 2000, I can execute the following SQL command: select * from table1 select * from table2 The output contains two record sets, one for each select statement. But if I do this with Oracle or MS Access (via ODBC connections), I got syntax errors. The question is, what is the correct way to execute a SQL command with two or more select statements? Is it supported by Oracle? Is there a way to get around it? Thanks. P.S. I know the problem is not with ODBC itself because I can do this with SQL Server 2000 via ODBC connection.[
My articles and software tools
-
toxcct wrote: you have to use ';' character to separate SQL statements Thanks. I tried it, did not work. I also tried "\n" and "\r\n" without success.[
My articles and software tools
-
With SQL Server 2000, I can execute the following SQL command: select * from table1 select * from table2 The output contains two record sets, one for each select statement. But if I do this with Oracle or MS Access (via ODBC connections), I got syntax errors. The question is, what is the correct way to execute a SQL command with two or more select statements? Is it supported by Oracle? Is there a way to get around it? Thanks. P.S. I know the problem is not with ODBC itself because I can do this with SQL Server 2000 via ODBC connection.[
My articles and software tools
-
if both tables are identical, you can use 'Select * from tab1 UNION Select * from tab2' in fact you can use the UNION statement whenever querys return a identical resultset. dirk
DiWa wrote: if both tables are identical Unfortunately, they are not identifical.[
My articles and software tools