Hi
I am working on DB2 ,I have a sql stmt in a procedure:

SET stmt='SELECT VCST3100.PRO_FAM_SYM_I, VCST3100.ORG_ORIGL_X,VCST3100.PRO_MFD_TIER_C,VCST3100.ORG_NSCC_I,VCST3100.ORG_BILL_PRNT_I, VCST3100_P.ORG_ORIGL_X as BILL_TO,VCST3100.FEE_EXCLN_C,VCST3100.ORG_GDTE_D,VCST3200.FEE_BILL_TYP_C,VCST3200.GLA_PW_I as N_GLA_PW_I ,VCST3200.FEE_BILL_TYP_C,VCST3200_1.GLA_PW_I as D_GLA_PW_I
FROM
ANSHUL.VCST3100 AS VCST3100,ANSHUL.VCST3100 AS VCST3100_P,ANSHUL.VCST3200 AS VCST3200,ANSHUL.VCST3200 AS VCST3200_1
WHERE
VCST3100.ED_END_M = ''9999-12-31-23.59.59.999999'' AND UPPER(VCST3100.ORG_BILL_PRNT_I)=UPPER(VCST3100_P.PRO_FAM_SYM_I) AND VCST3100_P.ED_END_M = ''9999-12-31-23.59.59.999999'' AND UPPER(VCST3100.PRO_FAM_SYM_I)=UPPER(VCST3200.PRO_FAM_SYM_I) and UPPER(VCST3100.PRO_FAM_SYM_I)=UPPER(VCST3200_1.PRO_FAM_SYM_I) AND UPPER(VCST3200.FEE_BILL_TYP_C)=''N'' AND UPPER(VCST3200_1.FEE_BILL_TYP_C)=''D'' AND VCST3200_1.ED_END_M = ''9999-12-31-23.59.59.999999'' AND VCST3200.ED_END_M = ''9999-12-31-23.59.59.999999''';

when i run this procedure it gives me the error:

ANSHUL.RTV_FUND_FMLY_LST - Exception occurred while running:
null
ANSHUL.RTV_FUND_FMLY_LST - Roll back completed successfully.
ANSHUL.RTV_FUND_FMLY_LST - Run failed.

But when i remove last 2 cols or any 2 cols from the sql stmt which i am retriving in my select stmt. the procedure runs fine.

kindly tell me what exactly is happenning here...

error stmt:
SET stmt='SELECT VCST3100.PRO_FAM_SYM_I, VCST3100.ORG_ORIGL_X,VCST3100.PRO_MFD_TIER_C,VCST3100.ORG_NSCC_I,VCST3100.ORG_BILL_PRNT_I, VCST3100_P.ORG_ORIGL_X as BILL_TO,VCST3100.FEE_EXCLN_C,VCST3100.ORG_GDTE_D,VCST3200.FEE_BILL_TYP_C,VCST3200.GLA_PW_I as N_GLA_PW_I ,
VCST3200.FEE_BILL_TYP_C,
VCST3200_1.GLA_PW_I as D_GLA_PW_I

correct stmt:
SET stmt='SELECT VCST3100.PRO_FAM_SYM_I, VCST3100.ORG_ORIGL_X,VCST3100.PRO_MFD_TIER_C,VCST3100.ORG_NSCC_I,VCST3100.ORG_BILL_PRNT_I, VCST3100_P.ORG_ORIGL_X as BILL_TO,VCST3100.FEE_EXCLN_C,VCST3100.ORG_GDTE_D,VCST3200.FEE_BILL_TYP_C,VCST3200.GLA_PW_I as N_GLA_PW_I

where clause has no problem

Thanx and Regards
Anshul