Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2011
    Posts
    41

    Question Unanswered: Problem with aliase name procedures

    We had moved the db from windows to Linux and we had created 2 users one for admin and other for the users.

    Tried giving alias names for procedures but was throwing an error,was able to give alias names for rest of them except for functions and procedures.
    ----
    ------following are the errors i was getting while trying on procedures kindly help
    db2 => CREATE ALIAS proc1 FOR db2.proc1!

    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0601N The name of the object to be created is identical to the existing
    name "db21.proc1" of type "ALIAS". SQLSTATE=42710

    db2 => CREATE OR REPLACE ALIAS proc1 FOR PROCEDURE db2.proc1!
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0104N Expected tokens may include: "<space>". SQLSTATE=42601

    db2 => CREATE OR REPLACE ALIAS proc1 FOR db2.proc1!
    SQL0403W The newly defined alias "db21.proc1" resolved to the
    object "db2.proc1" which is currently undefined. SQLSTATE=01522

    db2 => CREATE PUBLIC ALIAS proc1 FOR db2.proc1!
    SQL0403W The newly defined alias "SYSPUBLIC.proc1" resolved to the
    object "db2.proc1" which is currently undefined. SQLSTATE=01522

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Looking at the documentation for CREATE ALIAS (CREATE ALIAS - IBM DB2 9.7 for Linux, UNIX, and Windows), I read as the first sentence:
    The CREATE ALIAS statement defines an alias for a module, nickname, sequence, table, view, or another alias. Aliases are also known as synonyms.
    I don't see stored procedures mentioned as a valid target for an alias. Hence, you can't create aliases for SPs. You could create a new stored procedure with the desired name and that new procedure just calls the other one.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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