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 > dynamic sql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-23-05, 11:38
pradeepbill pradeepbill is offline
Registered User
 
Join Date: Sep 2005
Posts: 5
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;
Reply With Quote
  #2 (permalink)  
Old 09-23-05, 12:01
pradeepbill pradeepbill is offline
Registered User
 
Join Date: Sep 2005
Posts: 5
got it

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

thanks
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