Hi, The issue was delimiter character not set properly. After setting the delimiter character as */* and ignore the native delimiter, the above-mentioned error was gone but again I have got another issue as follows.
SQL Error [42704]: "DB2INST1.Tables" is an undefined name.. SQLCODE=-204, SQLSTATE=42704, DRIVER=4.23.42 com.ibm.db2.jcc.am.SqlSyntaxErrorException: "DB2INST1.Tables" is an undefined name.. SQLCODE=-204, SQLSTATE=42704, DRIVER=4.23.42 I could able to solve this issue using [1]. The reason was we should retrieve all the tables name using *SYSIBM.SYSTABLES*. [1] https://stackoverflow.com/a/3584161/6671627 Thanks, Nila. On Tue, Aug 28, 2018 at 4:11 PM, Nilasini Thirunavukkarasu < nilas...@wso2.com> wrote: > I am creating a stored procedure for db2. But it is giving an error saying > that > > > "SQL Error [42601]: An unexpected token "END-OF-STATEMENT" was found > > following "SS_TOKEN_BAK". Expected tokens may include: " END IF".. > > SQLCODE=-104, SQLSTATE=42601, DRIVER=4.23.42". > > Following is the part of my stored procedure which gives the above error. > > > > CREATE OR REPLACE PROCEDURE TOKEN_CLEANUP_SP > > BEGIN > > DECLARE batchSize INTEGER; > > -- ------------------------------------------ > -- CONFIGURABLE ATTRIBUTES > -- ------------------------------------------ > SET batchSize = 10000; > > -- ------------------------------------------------------ > -- BACKUP IDN_OAUTH2_ACCESS_TOKEN TABLE > -- ------------------------------------------------------ > IF EXISTS (SELECT TABLE_NAME FROM TABLES WHERE TABLE_NAME = > 'IDN_OAUTH2_ACCESS_TOKEN_BAK') > THEN > DROP TABLE IDN_OAUTH2_ACCESS_TOKEN_BAK; > END IF; > > END/ > > > Is anyone face this type of issue?. Any help on this would be much > appreciated. > > Thanks, > Nila. > > -- > Nilasini Thirunavukkarasu > Software Engineer - WSO2 > > Email : nilas...@wso2.com > Mobile : +94775241823 > Web : http://wso2.com/ > > > <http://wso2.com/signature> > -- Nilasini Thirunavukkarasu Software Engineer - WSO2 Email : nilas...@wso2.com Mobile : +94775241823 Web : http://wso2.com/ <http://wso2.com/signature>
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev