How to use SQL to build SQL, what is this called and give an example?
Submitted by: AdministratorThis is called dynamic SQL. An example would be:
set lines 90 pages 0 termout off feedback off verify off
spool drop_all.sql
select ?drop user ?||username||? cascade;? from dba_users
where username not in ("SYS?,?SYSTEM?);
spool off
Essentially you are looking to see that they know to include a command (in this case DROP USER...CASCADE;) and that you need to concatenate using the ?||? the values selected from the database.
Submitted by: Administrator
set lines 90 pages 0 termout off feedback off verify off
spool drop_all.sql
select ?drop user ?||username||? cascade;? from dba_users
where username not in ("SYS?,?SYSTEM?);
spool off
Essentially you are looking to see that they know to include a command (in this case DROP USER...CASCADE;) and that you need to concatenate using the ?||? the values selected from the database.
Submitted by: Administrator
Read Online SQL Plus Job Interview Questions And Answers
Top SQL Plus Questions
☺ | Explain ROWID? |
☺ | What is a join in Oracle? Explain the different types of joins? |
☺ | Explain Explicit Cursor attributes? |
☺ | How to use SQL to build SQL, what is this called and give an example? |
☺ | Explain How do we eliminate the duplicate rows? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Forms Reports Interview Questions. |