Home » SQL & PL/SQL » SQL & PL/SQL » how to create dynamic table
how to create dynamic table [message #204273] Sun, 19 November 2006 23:01 Go to next message
mane
Messages: 7
Registered: May 2006
Junior Member
hai,
I created a table named f3_schedule_all by joining three tables.
I want this table to be dynamic like a view. How can I do this?
Re: how to create dynamic table [message #204288 is a reply to message #204273] Sun, 19 November 2006 23:56 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
If you want a view, then create a view or a materialized view. There isn't any such thing as a dynamic table.
Re: how to create dynamic table [message #204564 is a reply to message #204273] Tue, 21 November 2006 05:02 Go to previous messageGo to next message
ananth.dikshit
Messages: 21
Registered: November 2006
Location: HYD
Junior Member
Hi,

Create a proceure just as below.

CREATE OR REPLACE PROCEDURE proc1
is
var varchar2(2000);
BEGIN
var := 'Create table tablename as select.........';
execute immediate var;
end;

Place your dynamic data in the select statement. If you want to use the same table then drop it before you create it again.
Re: how to create dynamic table [message #204578 is a reply to message #204564] Tue, 21 November 2006 05:42 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
In what way does this generate a dynamic table? All you've done is to wrap the CREATE TABLE statement into a procedure.
Re: how to create dynamic table [message #204604 is a reply to message #204578] Tue, 21 November 2006 06:28 Go to previous messageGo to next message
ananth.dikshit
Messages: 21
Registered: November 2006
Location: HYD
Junior Member
ok.

But in Oracle 10g I think there is some thing called dynamic view. Will that work?

Please let me know.

Thanks in advance.
Re: how to create dynamic table [message #204636 is a reply to message #204604] Tue, 21 November 2006 08:02 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
There's nothing new by that name that I can find here, just the v$ dynamic system views.

The best solutions to the OP's problem, as far as I can tell from the 25 word description of it are ( as Barbara Boehmer said) to either create a standard view based on the query used to create the table, or to create a materialized view (aka snapshot).
Previous Topic: De-Dupe using Select
Next Topic: help with query
Goto Forum:
  


Current Time: Sun Dec 11 02:01:17 CST 2016

Total time taken to generate the page: 0.04042 seconds