Re: How to get the ddl of a table in forms?

From: HansF <News.Hans_at_telus.net>
Date: Sat, 21 Jan 2006 14:31:29 GMT
Message-Id: <pan.2006.01.21.14.31.29.88635_at_telus.net>


[Quoted] On Sat, 21 Jan 2006 02:17:34 -0800, mentor1936 wrote:

>
> I appreciated the way you forward your information to me.
> But we would rather go with the SQL/data dictionary views that will
> also be worked with previous versions like 8i.
> Instead of using DBMS_METADATA is there other technique available for
> getting the ddl of any table in a schema.
>
> Also how should I populate the ddl of a table on forms screen after
> pressing the ddl button?
> Could some one send me a little piece of form's code in order to
> achieve what I am wanting on form's screen?
>

Personally I'd look at Oracle's Project Raptor - it has visual capability, can display DDL for tables in 9i and beyond, and can connect to 8i - worth checking whether it c an display the 8i DDL as well.

However, a LOOOONG time ago (Oracle6 & 7.0), I wrote a SQL statement to display DDL. Like DBMS_METADATA, it returned a single string (pref CLOB) after building up all the appropriate parts from USER_/ALL_/DBA_TABLES and ?_TAB_COLUMNS views. It went along the lines of:

SELECT 'CREATE TABLE '||a.owner_name ||'.' ||

                        a.table_name || ' (' || chr(13) ||
       '     ' || b.column_name || b.data_type ||
                  decode( b.data_type, 'NUMBER', 
   ...

although these days I'd probably get lazy and write it as a stored function instead of thinking how to use one SQL statement.

-- 
Hans Forbrich                           
Canada-wide Oracle training and consulting
mailto: Fuzzy.GreyBeard_at_gmail.com   
*** Top posting [replies] guarantees I won't respond. ***
Received on Sat Jan 21 2006 - 15:31:29 CET

Original text of this message