Home » SQL & PL/SQL » SQL & PL/SQL » How can i print the DDL for "create table in PLSQL(function get table name) ?
How can i print the DDL for "create table in PLSQL(function get table name) ? [message #269602] Sun, 23 September 2007 15:01 Go to next message
sammeras
Messages: 28
Registered: September 2007
Location: Israel
Junior Member

Hi
How can i print the DDL for "create table in PLSQL ?
Thats mean:
How can i get the creation table and print this DDL string in the sqlplus?
example..
I create function in PLSQL..get table nameas a vairable, this function, print the create DLL for this table
(CREATE TABLE tbl_name(id number Pk, name Varcha2, age number......ext' )

anybody can help me ?
Re: How can i print the DDL for "create table in PLSQL(function get table name) ? [message #269604 is a reply to message #269602] Sun, 23 September 2007 16:50 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Look up the documentation for DBMS_METDATA.
Re: How can i print the DDL for "create table in PLSQL(function get table name) ? [message #269605 is a reply to message #269602] Sun, 23 September 2007 16:53 Go to previous message
Soumen Kamilya
Messages: 128
Registered: August 2007
Location: Kolkata
Senior Member

Exactly DBMS_METADATA.GET_DDL to show DDL.

For Example:
set pagesize 0
set long 90000
SELECT DBMS_METADATA.GET_DDL('VIEW','DBA_TABLES') FROM dual;


Cheers
Soumen
Previous Topic: Display Employ Names in Horizontal?
Next Topic: Why is the keyword 'in' so much slower than '=' ?
Goto Forum:
  


Current Time: Sat Dec 03 20:31:45 CST 2016

Total time taken to generate the page: 0.07458 seconds