dbTalk Databases Forums  

Eliminating "COMMENT TO PRESERVE FORMAT" from reload.sql

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Eliminating "COMMENT TO PRESERVE FORMAT" from reload.sql in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
EJ
 
Posts: n/a

Default Eliminating "COMMENT TO PRESERVE FORMAT" from reload.sql - 11-30-2009 , 09:48 AM






Hi,

I'm using SQL Anywhere 9.0.2.3546. I do not want "COMMENT TO PRESERVE
FORMAT" statements in "reload.sql" created from dbunload because I do
impact analysis by text-searching "reload.sql".

I have tried to execute the following, but subsequent dbunload
executions still contain the "Comment to Preserve Format" statements :

SET OPTION "PUBLIC"."Preserve_source_format" = 'Off'
go

It seems there is a corresponding database property db_property (
'PreserveSource' ). This property remains 'On' even after setting
option "Preserve_source_format" to off.

I suspect I would have what I need if property 'PreserveSource" were
'Off', but the only way I can find to set it off (option
"Preserve_source_format") does not seem to do the trick.

Thanks in advance for any help!

Reply With Quote
  #2  
Old   
Bruce Hay
 
Posts: n/a

Default Re: Eliminating "COMMENT TO PRESERVE FORMAT" from reload.sql - 11-30-2009 , 10:47 AM






After setting the preserve_source_format database option to 'off', you will need
to cause the preserved source to be discarded for each procedure. This can be
done by executing:
comment to preserve format on procedure owner.procname is null
for each procedure. You could do this for all procedures in the database using a
FOR statement and EXECUTE IMMEDIATE. Of course, by doing so you will lose the
ability to view the procedures as they were originally formatted when using
Sybase Central.

Alternatively, you could just post-process the reload.sql file using a Perl or
Python script to strip out the COMMENT statements.

SQL Anywhere Developer Community:
http://www.sybase.com/developer/libr...ere-techcorner


SQL Anywhere Blog Center: http://www.sybase.com/sqlanyblogs




EJ wrote:
Quote:
Hi,

I'm using SQL Anywhere 9.0.2.3546. I do not want "COMMENT TO PRESERVE
FORMAT" statements in "reload.sql" created from dbunload because I do
impact analysis by text-searching "reload.sql".

I have tried to execute the following, but subsequent dbunload
executions still contain the "Comment to Preserve Format" statements :

SET OPTION "PUBLIC"."Preserve_source_format" = 'Off'
go

It seems there is a corresponding database property db_property (
'PreserveSource' ). This property remains 'On' even after setting
option "Preserve_source_format" to off.

I suspect I would have what I need if property 'PreserveSource" were
'Off', but the only way I can find to set it off (option
"Preserve_source_format") does not seem to do the trick.

Thanks in advance for any help!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.