When using Toad to create a view in Oracle, how can I store the formatted script also? -


this question may toad specific. have no idea how oracle stores views, i'll explain happens when use toad. if answer oracle specific, better.

i have created rather complex view. make clearer, have formatted code nicely, , entered comments needed. when need make changes view, use toad's "describe objects" window, can find script recreate view. problem formatting gone. comments before select keyword (but after "create view xxx as") disappear.

if enter script create view:

create or replace view testviewformatting -- here have long comment explaining role of  -- view , things aware of if changing it.  -- unfortunately comment disappear... select    name,          --this comment kept   accountnumber  --this   debtable   name 's%'; 

toad display when describe later:

drop view xxx.testviewformatting;  /* formatted on 04.07.2012 09:35:45 (qp5 v5.185.11230.41888) */ create or replace force view xxx.testviewformatting (    name,    accountnumber )    select name,                                    --this comment kept                accountnumber                                       --this      debtable     name 's%'; 

note first comment has disappeared, , format totally different.

i suspect oracle doesn't store code of view, parsed version, , when toad brings script, reverses parsed version , generates script on fly.

what have make toad/oracle keep original formatting?

(ps: know can change settings toad's code formatter, not want do. due questionable choices in past, particular view has several levels of inline views, , need specific formatting make clear happens)

select text user_views view_name = 'your_view_name'; 

i've tested with:

create view z_v_test  select -- te  --st *  dual; 

and keeps blank line.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -