If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > PUT ROUTINE syntax

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-17-09, 08:56
rocker86 rocker86 is offline
Registered User
 
Join Date: Jul 2009
Posts: 37
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
Reply With Quote
  #2 (permalink)  
Old 07-17-09, 10:09
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
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-'
Quote:
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.
Reply With Quote
  #3 (permalink)  
Old 07-17-09, 10:15
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On