Home » SQL & PL/SQL » SQL & PL/SQL » dynamic Query
dynamic Query [message #190760] Fri, 01 September 2006 02:47 Go to next message
sv.venkat
Messages: 12
Registered: July 2006
Location: HYDERABAD
Junior Member
Dear Friends,
What is Dynamic Query and Temporary tables?
Pl.let me know.
Thanks in advance.
Venkat.
Re: dynamic Query [message #190762 is a reply to message #190760] Fri, 01 September 2006 02:50 Go to previous messageGo to next message
kimant
Messages: 201
Registered: August 2006
Location: Denmark
Senior Member
Hi

This You can find in the documentation, and it is *free*!
- Even for download.

otn.oracle.com > documentation.

Br
Kim
Re: dynamic Query [message #190971 is a reply to message #190760] Sun, 03 September 2006 11:41 Go to previous messageGo to next message
be2sp1
Messages: 52
Registered: September 2005
Location: India
Member
Dynamic query is a query that is formed at run-time of the execution of the DB object say a procedure. A very simple
example would be.......

declare
v_table varchar2(20):='EMP_copy';
begin
EXECUTE IMMEDIATE 'CREATE TABLE ' || v_table || ' as selct * from emp';
end;

On firing this block a table will be created with the same structure as of emp along with its data.

About temporary tables kindly do some search on internet you will find a lot of documentation available.

Re: dynamic Query [message #190975 is a reply to message #190971] Sun, 03 September 2006 12:46 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
And here is THE best proof why you want to avoid dynamic sql (as much as possible).
This block will NOT create a table, it will generate an error.

[Updated on: Sun, 03 September 2006 12:46]

Report message to a moderator

Re: dynamic Query [message #191080 is a reply to message #190975] Mon, 04 September 2006 07:18 Go to previous message
be2sp1
Messages: 52
Registered: September 2005
Location: India
Member
Hmm........the block is working after correcting the typo error of SELECT.

Thanks
Previous Topic: Rebuild an index -ONLINE-
Next Topic: How to call c language function in pl/sql
Goto Forum:
  


Current Time: Tue Dec 03 11:59:57 CST 2024