If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 v9.1 Export Stored Procedures

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-14-10, 12:48
rockycj rockycj is offline
Registered User
 
Join Date: Feb 2007
Posts: 73
DB2 v9.1 Export Stored Procedures

I'm using DB2 v9.1 and would like to export some Stored Procedures through Unix. I've never done this before and am trying but getting an error.

There is a Stored Procedure called "XMLTEST" that I would like to export.

When I run "db2 -td@ -vf XMLTEST", I get this error: DB21005E An error occurred while accessing the file XMLTEST.


Here is an example that I have:

db2 -td@ -vf [location]\spemployee_export.sql.

Not sure about the location. Here is where the SQL Stored Procedure is in db2: DATABASE > Schemas > E1USER > Stored Procedures > XMLTEST.

I'm logged into E1USER as this:

db2 CONNECT TO DATABASE USER E1USER USING password.

Could someone help with how to run an export of Stored Procedures? I need to save these Stored Procedures because I want to run a Restore of PSFTPROD database.

Thank you.

CC
Reply With Quote
  #2 (permalink)  
Old 06-14-10, 16:06
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
The purpose of
Code:
db2 -td@ -vf XMLTEST
is to run DB2 commands and statements in the file XMLTEST, not to export stored procedures.

To extract database objects (including stored procedures) you would use the db2look utility.

Code:
db2look -d yourdb -e -z yourschema -o outputfile
Check the manual for details.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On