By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,287 Members | 1,284 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,287 IT Pros & Developers. It's quick & easy.

Preserving comments when creating SP's from Command Editor

P: n/a
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

Mar 6 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Aj-India wrote:
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.

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
Mar 6 '06 #2

P: n/a
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

Mar 7 '06 #3

P: n/a
Try this one

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

Mar 7 '06 #4

P: n/a
Ian
Aj-India wrote:
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.


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@
Mar 9 '06 #5

P: n/a
Dear Shashi,

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

Cheers,
Ajit

Mar 9 '06 #6

P: n/a
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

Mar 9 '06 #7

P: n/a
Try the export from text and syscat.procedures

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

cheers...
Shashi Mannepalli

Mar 9 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.