IBM Support

Recreating SQL Stored Procedures from db2look DDL when the CREATE PROCEDURE statements are not in dependency order.

Troubleshooting


Problem

The db2look utility displays the DDL for the SQL Stored Procedures in the order of their creation time, not in the order of their dependencies. This can present a problem when using the db2look DDL to recreate the database. Big systems have hundreds of stored procedures that must be reordered manually into dependency order so that nested procedures are created before their callers. Example: 1) create SP1 2) create SP2 -> which calls SP1 3) drop SP1 4) create SP1 In the above scenario, db2look generates the CREATE PROCEDURE statement for SP2 before the CREATE PROCEDURE statement for SP1. Since SP1 does not yet exist, replaying the DDL for SP2 first will fail. 

Symptom

After running the file generated by db2look, the following error message will be displayed:

DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0440N  No authorized routine named "SP1" of type "PROCEDURE"
having compatible arguments was found.  LINE NUMBER=20.  SQLSTATE=42884    

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"DB2 Tools - db2look","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7","Edition":"Advanced Enterprise Server;Enterprise Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

More support for:
Db2 for Linux, UNIX and Windows

Software version:
9.7

Operating system(s):
AIX, HP-UX, Linux, Solaris, Windows

Document number:
159145

Modified date:
30 April 2025

UID

swg21499119

Manage My Notification Subscriptions