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)