Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Developer - how do I display View SQL DDL in stored format

732412Nov 25 2009 — edited Aug 18 2010
Hello.
I'm using SQL Developer 2.1.0.63.10. When I access a view it displays the SQL DDL in a different format than what is stored in the database. How do I change SQL Developer's behavior so that I can see the stored code as is? Some examples of very simple views below (obviously the first two lines will change and that is expected).

Only options from Tools | Preferences | Database | ObjectViewer that have an impact at the level I'm concerned with are Show Terminator, Show Force and Show Schema; all good and working as desired.

Thanks,
Luke

Example 1:
Original code

CREATE OR REPLACE VIEW sample_view_of_schemas
AS
SELECT   username
FROM     all_users;
SELECT text FROM user_views WHERE view_name = 'SAMPLE_VIEW_OF_SCHEMAS';

TEXT
------------------------
SELECT   username
FROM     all_users
SQL display

CREATE OR REPLACE FORCE VIEW "TEST_SCHEMA"."SAMPLE_VIEW_OF_SCHEMAS" ("USERNAME")
AS
  SELECT username FROM all_users;
Example 2:
Original code

CREATE OR REPLACE VIEW sample_view_of_schemas
AS
SELECT   *
FROM     all_users;
SELECT text FROM user_views WHERE view_name = 'SAMPLE_VIEW_OF_SCHEMAS';

TEXT
------------------------
SELECT   "USERNAME","USER_ID","CREATED"                                                                                                                                                     
FROM     all_users
SQL display

CREATE OR REPLACE FORCE VIEW "CMON_USB"."SAMPLE_VIEW_OF_SCHEMAS" ("USERNAME", "USER_ID", "CREATED")
AS
  SELECT "USERNAME","USER_ID","CREATED" FROM all_users;
Example 3:
Original code

CREATE OR REPLACE VIEW sample_view_of_schemas
AS
SELECT   username  schema_name
       , user_id   schema_id
FROM     all_users;
SELECT text FROM user_views WHERE view_name = 'SAMPLE_VIEW_OF_SCHEMAS';

TEXT
------------------------
SELECT   username  schema_name
       , user_id   schema_id
FROM     all_users
SQL display

CREATE OR REPLACE FORCE VIEW "CMON_USB"."SAMPLE_VIEW_OF_SCHEMAS" ("SCHEMA_NAME", "SCHEMA_ID")
AS
  SELECT username schema_name , user_id schema_id FROM all_users;
Edited by: Luke Mackey on Nov 27, 2009 11:41 AM (revised scope to View SQL DDL)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2010
Added on Nov 25 2009
5 comments
26,286 views