In SQL*Plus, I want to execute multiple SQL queries in single line like
create table emp(name varchar2(20)); desc emp;
I tried executing this one but didn't work for me.
BEGIN OPEN :1 FOR SELECT * FROM table1; OPEN :2 FOR SELECT * FROM table2; END;
is there any way to accomplish this?
Thanks in advance!
desc empis NOT a SQL query, it is a SQL*Plus command (which SQL*Plus translates, behind the scenes - invisible to you! - into an actual SQL query against several data dictionary tables). Technically there should be no semicolon afterdesc empalthough SQL*Plus may be flexible and not throw an error. Then, your second line of code is not a SQL query either, it is a PL/SQL block. It seems that you have very, very basic understanding issues; go back to the first 15-20 pages of your textbook and re-read about SQL vs. PL/SQL vs. SQL*Plus, they are very different things.insert into emp (name) values('Foo')and 'select * from emp` in a single line is this possible? Thanks in advance :D