IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQLCODE -206, Bind error


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
CHANDAN KAPOOR

New User


Joined: 12 Apr 2008
Posts: 36
Location: NOIDA

PostPosted: Wed Jan 06, 2010 2:01 pm
Reply with quote

In the below query I am getting sqlcode -206 during pre compilation and bind error.

Code:
INSERT INTO  TE.UTE01011_ACFTDEFCT
( ACFTABB ,                       
  ACDFDTE ,                       
 PTNOFITT )

VALUES                           
(:DCLUTE01011_ACFTDEFCT.ACFTABB ,
 :DCLUTE01011_ACFTDEFCT.ACDFDTE ,
 :DCLUTE01011_ACFTDEFCT.PTNOFITT)

The error in bind is

Code:
_UDB2 BIND SQL ERROR   
 USING END01 AUTHORITY
 PLAN=(NOT APPLICABLE)
 DBRM=TEARMN           
 STATEMENT=2735       
 SQLCODE=-206         
 SQLSTATE=42703       
 TOKENS=PTNOFITT       
 CSECT NAME=DSNXORSO   
 RDS CODE=-100         

Can somebody help me regarding this.

Thanks,
Chandan

Edited: Please use BBcode when You post some code/error, that's rather readable.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Jan 06, 2010 2:05 pm
Reply with quote

Column PTNOFITT does not exist in TE.UTE01011_ACFTDEFCT. Make sure you are referring to the table in the right region.
Back to top
View user's profile Send private message
CHANDAN KAPOOR

New User


Joined: 12 Apr 2008
Posts: 36
Location: NOIDA

PostPosted: Wed Jan 06, 2010 2:07 pm
Reply with quote

I have checked the column PTNOFITT does exist in the table TE.UTE01011_ACFTDEFCT , Its throwing error for this column only .
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Jan 06, 2010 4:06 pm
Reply with quote

Its something to do with compiler options APOST , APOSTSQL
Back to top
View user's profile Send private message
CHANDAN KAPOOR

New User


Joined: 12 Apr 2008
Posts: 36
Location: NOIDA

PostPosted: Wed Jan 06, 2010 4:36 pm
Reply with quote

Hi Prem,

I haven't got it , Could you explain in brief reg the compiler options
options APOST , APOSTSQL , Im using PL1 as host language.

thanks,
Back to top
View user's profile Send private message
Lijo

New User


Joined: 24 Aug 2008
Posts: 41
Location: Cochin

PostPosted: Wed Jan 06, 2010 4:53 pm
Reply with quote

premkrishnan wrote:
Quote:
Its something to do with compiler options APOST , APOSTSQL


I couldn't link these options to this context icon_rolleyes.gif .

Chandan,
You've hardcoded TE qualifier in your SQL. But is the same table (UTE01011_ACFTDEFCT) exists under any other qualifier? If yes, is that table having this particular column? Also, which qualifier you're using for bind?
Back to top
View user's profile Send private message
CHANDAN KAPOOR

New User


Joined: 12 Apr 2008
Posts: 36
Location: NOIDA

PostPosted: Wed Jan 06, 2010 5:34 pm
Reply with quote

I have used same qualifier for other tables as well in this program and this column also exists in other tables with the same qualifier.

Reg bind we do not specify any qualifier during bind , We use endevor to bind.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jan 07, 2010 8:26 am
Reply with quote

CHANDAN KAPOOR,

The processes (in order) are:
  1. pre-compile
  2. compile
  3. link-edit
  4. bind

therefore your title
Quote:
SQLCODE -206 bind error during Precompilation
indicates your lack of knowledge.

also,
Quote:
Reg bind we do not specify any qualifier during bind , We use endevor to bind.

also is a statement based on ignorance.
so now that we have established you expertise - or rather lack of it,
why don't we start over...

for the most part, when the DB2 Bind process delivers an error,
it can be taken for literal truth, that you have an error.

now
Quote:
STATEMENT=2735

are you sure that pre-compile statement 2735 is the sql that you have provided?

you can always go to the pre-compiler generated DBRM and use my macro
DBRMLN found at this link and look at the sql in the dbrm to insure you have the correct sql that the bind says is failing.

stop being a dickhead about this. you have an error!

also, qualifying your table names in imbedded sql is poor practice.
Since you undoubtedly do not have access to production db2 tables in your development environment,
how do you expect to access the prod tables with your program without changing the qualifier in your sql?

if you would provide us with the bind parms used,
which can be found in your output listing - a few line above what you provided
it would help us to help you.
Of special importance in your bind parms is the Qualifier.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Jan 07, 2010 1:57 pm
Reply with quote

dbzTHEdinosauer wrote:
also, qualifying your table names in imbedded sql is poor practice.
Since you undoubtedly do not have access to production db2 tables in your development environment,
how do you expect to access the prod tables with your program without changing the qualifier in your sql?

All our embedded sql uses qualified tables.
dev and prod are different DB2's thus different SSID's, So I don't see the problem of accessing the correct environment table.
Imho it is poor practice to use different schemas for dev and prod.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jan 07, 2010 3:09 pm
Reply with quote

GuyC,

point taken. I just feel that it is silly to qualify in the program, when you can accomplish the same in the bind. Thus, if for some reason the schema was to change, (not the db2 tables or layout), you would not need to edit/change/recompile/link/bind all programs.

by the way, any idea why the bind for the TS is giving him problems, since you are from one of those shops that imbeds qualifiers?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Jan 07, 2010 3:28 pm
Reply with quote

Our schemanames are by application area. since so many programs are cross-application we often have different schema's in one program.
It is easier to qualify then correlate program to application to schema at bind time.
Of course this is site dependant, I've seen sites where the schema is the business and the same program runs on different tables in multi-business companies.

For the TS :
You already established that the table exists and the column name is correct in the environment where the bind happens, so I can think of two other possibilities :
- Is it really a table or a view ?
- Is the column an identity column generated always ?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top