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
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
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
Try this one
Get the text of the stored procedures from syscat.procedures and
re-create that in your production envirornment.
cheers....
Shashi Mannepalli
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@
Dear Shashi,
I find that the text does not contain the full content of the
syscat.procedures.
Cheers,
Ajit
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
Try the export from text and syscat.procedures
Check the other posts regarding the EXPORT of LOB's...etc
cheers...
Shashi Mannepalli
|
|
|
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.
Top Community Contributors
|