Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2007
    Posts
    84

    Unanswered: 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

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •