Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2017
    Posts
    3

    Question Unanswered: DB2 admin_copy_schema questions?

    Hello together,

    I am new here and I am a newbie in db2 ;-)

    I want to copy the schema in my test database. But I have questions to the used stored procedure.

    Command:
    Call sysproc.admin_copy_schema ('MY_SOURCE_SCHEMA', 'MY_TARGET_SCHEMA', 'COPY', NULL, NULL, NULL,'COPYSCHEMA', 'COPYERROR');

    The tablespace systoolspace was already created by db2 installation.

    Then I get the error message:
    Der Parametermodus OUT oder INOUT ist für einen Parameter in der Routine "ADMIN_COPY_SCHEMA" mit dem spezifischen Namen "ADMIN_COPY_SCHEMA" (Parameternummer "7", Name "ERRORTABSCHEMA") ungültig.. SQLCODE=-469, SQLSTATE=42886, DRIVER=3.68.61

    My question now is, what is the 'COPYSCHEMA' and 'COPYERROR' parameter? do I need to create something? Or where can I find this schema or table?

    Thanks

  2. #2
    Join Date
    Jan 2003
    Posts
    4,299
    Provided Answers: 5
    Code:
    SQL0469N  The parameter mode OUT or INOUT is not valid for a parameter
          in the routine named "<routine-name>" with specific name
          "<specific-name>" (parameter number "<number>", name
          "<parameter-name>").
    
    Explanation:
    
    A parameter in an SQL procedure is declared as OUT and the corresponding
    argument is not a valid assignment target. For functions only, a
    parameter is declared as OUT or INOUT and the corresponding argument is
    not an SQL variable, global variable, or SQL parameter.
    
    A constant or an expression is an example of an invalid argument for OUT
    or INOUT parameters.
    
    For example, if a function named my_function was declared to have one
    OUT parameter, the following function call is not valid because the
    argument that is passed to the OUT parameter cannot have values assigned
    to it:
    
    SET my_variable = my_function( 1 + 2 );
    
    User response:
    
    If calling an SQL procedure, change the output argument to a valid
    assignment target. If invoking a function, change the OUT or INOUT
    argument to an SQL variable, global variable, or SQL parameter.
    
    sqlcode: -469
    
    sqlstate: 42886
    According to the error and the documentation, those are INOUT parameters. The error means you cannot call it with a literal for those two parameters, you need to use variables.

    Andy

  3. #3
    Join Date
    Feb 2017
    Posts
    3

    thanks for your answer

    Thanks Andy, but I do not understand what you want to say.

    sorry.

    What parameter is wrong. If I look to the error message I thought that parameter seven has the problem. But I also tried NULL.

    Do you knwor what I need to type in?

    Thanks

  4. #4
    Join Date
    Apr 2012
    Posts
    1,066
    Provided Answers: 21
    Post the output of the db2level command , and your operating-system exact detail.
    Always remember to give these facts when you ask for help because the answer can depend on that information.


    This command sequence works for me on a V9.7.0.7 old version:

    db2 "call sysproc.admin_copy_schema('USER1','USER3','COPY',N ULL,NULL,NULL,'X','Y')"

    Value of output parameters
    --------------------------
    Parameter Name : ERRORTABSCHEMA
    Parameter Value : X

    Parameter Name : ERRORTABNAME
    Parameter Value : Y

    Return Status = 0

    db2 "select count(*) from X.Y"

    1
    -----------
    3

    1 record(s) selected.

    db2 "select count(*) from X.Y"

    1
    -----------
    3

    1 record(s) selected.

    db2 "select sqlcode, substr(diagtext,1,40), substr(statement,1,40) from x.y"

    SQLCODE 2 3
    ----------- ---------------------------------------- ----------------------------------------
    0 Unsupported JAR object in source No DDL
    0 Unsupported JAR object in source No DDL
    0 Unsupported JAR object in source No DDL

    3 record(s) selected.

  5. #5
    Join Date
    Feb 2017
    Posts
    3

    Solution found

    I got it.

    I need to create a table for the reports of the sp.

    Thanjks for all your help

  6. #6
    Join Date
    Apr 2012
    Posts
    1,066
    Provided Answers: 21
    It was not necessary for me to create the X.Y table - it did not pre-exist, instead the sproc created and populated it automatically.
    Your unspecified DB2version+fixpack might behave differently, but until you post those facts others cannot guess them.

Posting Permissions

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