DB2 Stored Procedure Migration

Source: Internet
Author: User
Tags chr db2 rtrim

I. Exporting stored procedures

EXPORT to D:/procudure/procudure.del of Del MODIFIED by Lobsinfile
SELECT ' SET current SCHEMA ' | | RTrim (procschema) | | ' @ ' | | Chr (10) | | SET current PATH = Sysibm,sysfun,sysproc, ' | | RTrim (procschema) | | | Chr (10) | | text| | Chr (10) | | @ ' | | Chr (10)
From syscat.procedures WHERE procschema = ' ILS ' ORDER by Create_time;

Executing the above export statement is to export the schema as a stored procedure under ILS as a file, because there is an order by create_time, so the order of the export is established in the order of the original stored procedure.

You're done, you should see two files in G:/procudure.

1. Procudure.del

2. Procudure.del.001.lob

Ii. Importing stored Procedures

The next step, of course, is to import the stored procedures under other DB:

1. Enter the directory where the stored procedure is located under the command line

2. Connect to the Db:connect to CMDB user xxx using XXX for import

3. DB2 [email protected]-VF Procudure.del.001.lob

DB2 Stored Procedure Migration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.