Results 1 to 2 of 2

Thread: dynamic sql

  1. #1
    Join Date
    Sep 2005
    Posts
    5

    Unanswered: dynamic sql

    DECLARE stm STATEMENT;

    when I declare the above statement in the following STORED PROCEDURE
    it complains with the following error...please help

    DB2DEV.PROCEDURE_LOGIAL: 36: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "<statement declaration>" was found following "". Expected tokens may include: "<SQL statement>". LINE NUMBER=36. SQLSTATE=42601


    CREATE PROCEDURE DB2DEV.PROCEDURE_LOGIAL
    (IN P_CLIENT_CD CHARACTER(5),
    IN P_PROVIDER_ID VARCHAR(20),
    IN P_ADDRESS_TYPE_CD VARCHAR(10)
    )
    SPECIFIC DB2DEV.PROCEDURE_LOGIAL
    LANGUAGE SQL
    NOT DETERMINISTIC
    CALLED ON NULL INPUT
    MODIFIES SQL DATA
    INHERIT SPECIAL REGISTERS
    ------------------------------------------------------------------------
    -- SQL Stored Procedure
    ------------------------------------------------------------------------
    P1: BEGIN

    -- DECLARE VARIABLES
    DECLARE p_v_source_type_cd VARCHAR(40);
    DECLARE v_update_master SMALLINT; -- FLAG THAT INDICATES IF MASTER TABLE SHOULD BE UPDATED (1 - UPDATE PERFORMED, 0 - NO UPDATE PERFORMED)

    DECLARE s_address_line1 VARCHAR(40);
    DECLARE s_address_line2 VARCHAR(40);
    DECLARE ret VARCHAR(10);
    DECLARE stm STATEMENT;

  2. #2
    Join Date
    Sep 2005
    Posts
    5

    got it

    sorry guys , I made a mistake above it...I could resolve it.

    thanks

Posting Permissions

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