0

I don't have much experience with Oracle and its 11g database SQL language.

Does the SQLPLUS have some command or procedure to view the SQL that defines a table, stored procedure, or other database objects?

I know there's a DESCRIBE command, but it doesn't show the SQL.

1
  • DESCRIBE would have been my guess too. I feel like the end user isn't meant to see the PLSQL. What do you need to see that for anyhow?
    – Ryan Gray
    Commented Aug 1, 2012 at 19:58

1 Answer 1

2

The following will show you the full DLL for the table FOOBAR in the current schema:

select dbms_metadata.get_ddl('TABLE', 'FOOBAR')
from dual;

More details in the manual: http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_metada.htm#i1019414

Btw: a CREATE TABLE statement is not PL/SQL, it's "just" SQL. PL/SQL is the language you use (only) in procedures (or PL/SQL blocks).

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.