sqlcode -276 received using DBSQLPR
search cancel

sqlcode -276 received using DBSQLPR

book

Article ID: 124567

calendar_today

Updated On:

Products

Datacom Datacom/AD Datacom/DB DATACOM - AD DATACOM - AD

Issue/Introduction

I received SQL error -276 when using DBSQLPR. The following is executed:

SELECT....
....WHERE....
AND TB1."DIST"=? 
AND TB1."PROD_NBR"=? AND ..... 
..... 

and receiving error:
SQLCODE = -276, SQLSTATE=53S35 
MESSAGE = SQLDA SPECIFIES 2 FEWER HOST VARIABLES THAN IN STATEMENT                                                   

Environment

z/os, CA Datacom/SQL All releases

 

Resolution

DBSQLPR does not support Host Variables.


Additional Information

Documentation for -276 - SQLDA SPECIFIES n FEWER HOST VARIABLES THAN IN STATEMENT 

Explanation:                                                            
                                                                       
      The number of input host variables and SQLDA entries is different. 
                                                                         
      The SQLSTATE that equates to this SQL return code is 53S35.       

User response:

The system interfacing between your program and the Multi-User Facility (DQ,    
DDOL, IDEAL, SQL, SQL COBOL Preprocessor, and so on) is responsible for sending 
SQLDA with the same number of host variables as declared at bind-time.  However,
you may have executed an old version of your program.  Check to ensure the      
program is linked into the proper library and if it is executing from CICS, that the
new version is being executed.