sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Aj-India's Avatar

Preserving comments when creating SP's from Command Editor


Question posted by: Aj-India (Guest) on March 6th, 2006 09:05 AM
Is there anyway that I could preserve the comments when creating an SP
from Command Editor,so that when i import the SP in the development
center I can see them. The reason for such a request is that I am
moving SP's from the development environment to the production
environment and would prefer to run them as a script in command editor.

Cheers,

Aj

7 Answers Posted
Serge Rielau's Avatar
Guest - n/a Posts
#2: Re: Preserving comments when creating SP's from Command Editor

Aj-India wrote:[color=blue]
> Is there anyway that I could preserve the comments when creating an SP
> from Command Editor,so that when i import the SP in the development
> center I can see them. The reason for such a request is that I am
> moving SP's from the development environment to the production
> environment and would prefer to run them as a script in command editor.[/color]
DB2 for LUW already preserves comments for CREATE PROCEDUREs.
What platform/version are you on and what are you (not) seeing?

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Aj-India's Avatar
Guest - n/a Posts
#3: Re: Preserving comments when creating SP's from Command Editor

I am using DB2 v8.1.7.445.
For eg if I run an SP from command editor which has comments that start
with "--",they are created successfully.But in Development center when
I refresh the server view and look at the source code of the SP, I see
every thing except the comments.

Cheers,
Aj

Shashi Mannepalli's Avatar
Shashi Mannepalli March 7th, 2006 03:25 PM
Guest - n/a Posts
#4: Re: Preserving comments when creating SP's from Command Editor

Try this one

Get the text of the stored procedures from syscat.procedures and
re-create that in your production envirornment.


cheers....
Shashi Mannepalli

Ian's Avatar
Guest - n/a Posts
#5: Re: Preserving comments when creating SP's from Command Editor

Aj-India wrote:[color=blue]
> I am using DB2 v8.1.7.445.
> For eg if I run an SP from command editor which has comments that start
> with "--",they are created successfully.But in Development center when
> I refresh the server view and look at the source code of the SP, I see
> every thing except the comments.[/color]

Does you code look like this?


-- sp1.sql
-- this procedure does something
--
create procedure sp1 ()
begin
...
end@

DB2 ignores the comments outside of the procedure body (i.e. the first 3
lines above) when the procedure is created.

Try:


create procedure sp1 ()
begin
-- sp1.sql
-- this procedure does something
--

...
end@


Aj-India's Avatar
Guest - n/a Posts
#6: Re: Preserving comments when creating SP's from Command Editor

Dear Shashi,

I find that the text does not contain the full content of the
syscat.procedures.

Cheers,
Ajit

Aj-India's Avatar
Guest - n/a Posts
#7: Re: Preserving comments when creating SP's from Command Editor

Dear Ian,
My SP looks exactly like the one you suggested to try

create procedure sp1 ()
begin
-- sp1.sql
-- this procedure does something
--


...
end@

but as I stated my SP would have none of the comments when i later
check it in server view of Development center.

Cheers,
Ajit

Shashi Mannepalli's Avatar
Shashi Mannepalli March 9th, 2006 08:05 PM
Guest - n/a Posts
#8: Re: Preserving comments when creating SP's from Command Editor

Try the export from text and syscat.procedures

Check the other posts regarding the EXPORT of LOB's...etc

cheers...
Shashi Mannepalli

 
Not the answer you were looking for? Post your question . . .
196,998 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,998 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors