Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Posts
    44

    Unanswered: PUT ROUTINE syntax

    Hi, I am trying to import a stored procedure on another machine but do not want the original schema that accompanies it, I read somewhere the following command does it, but is giving a syntactical error for the 'USE REGISTERS' part:


    'PUT ROUTINE FROM exportsp USE REGISTERS'

    I know its a newbie doubt..
    would appreciate some help,
    Thanks

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Ypu can find syntax and description on Information Center.
    Here is DB2 9.5 Information Center:
    https://publib.boulder.ibm.com/infoc...v9r5/index.jsp

    Code:
    Command syntax
    
    >>-PUT ROUTINE--FROM--file-name--------------------------------->
    
    >--+-------------------------------------+---------------------><
       '-OWNER--new-owner--+---------------+-'   
                           '-USE REGISTERS-'
    Command parameters

    FROM file-name
    Names the file where routine SQL archive (SAR) is stored.

    OWNER new-owner
    Specifies a new authorization name that will be used for authorization checking of the routine. The new owner must have the necessary privileges for the routine to be defined. If the OWNER clause is not specified, the authorization name that was originally defined for the routine is used.

    USE REGISTERS
    Indicates that the CURRENT SCHEMA and CURRENT PATH special registers are used to define the routine. If this clause is not specified, the settings for the default schema and SQL path are the settings used when the routine is defined. CURRENT SCHEMA is used as the schema name for unqualified object names in the routine definition (including the name of the routine) and CURRENT PATH is used to resolve unqualified routines and data types in the routine definition.
    So, you should specify "OWNER new-owner".
    "USE REGISTERS" can specify after "OWNER new-owner" clause.

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Stored procedures written using LANGUAGE SQL can be extracted with the 'db2look' tool and simple re-created. So you won't need PUT ROUTINE or GET ROUTINE any longer.
    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
  •