Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011
    Posts
    1

    Unanswered: SQL0206N SQLSTATE=42703. Please help!

    I'm new to DB2. I've created a sample procedure:

    connect to SAMPLE
    @
    DROP PROCEDURE SP_BI_DEMO ()
    @

    CREATE PROCEDURE SP_BI_DEMO()
    DYNAMIC RESULT SETS 0

    BEGIN
    CALL SYSPROC.ADMIN_CMD ('LOAD FROM (SELECT concat("0000" , FLD1) , FLD2 FROM T_SOURCE) OF CURSOR REPLACE INTO T_TARGET');

    END
    @

    CONNECT RESET
    @

    --------------------------------
    When executing the procedure, the system returns
    SQL0206N "0000" is not valid in the context where it is used. SQLSTATE=42703".

    Can anyone tell me what went wrong? Thanks.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    concat("0000" , FLD1)
    if " db2 handles this as column name
    if this is a literal use ' instead
    all basics for db2 can be found at
    IBM DB2 9.5 Information Center for Linux, UNIX, and Windows
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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