Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SQLCODE -206, Bind error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: SQLCODE -206, Bind error
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    Post subject:
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    Post subject: Reply to: SQLCODE -206 bind error during Precompilation
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

Moderator


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

PostPosted: Wed Jan 06, 2010 4:06 pm    Post subject:
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    Post subject: Reply to: SQLCODE -206 bind error during Precompilation
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    Post subject: Reply to: SQLCODE -206 bind error during Precompilation
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    Post subject: Reply to: SQLCODE -206 bind error during Precompilation
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: 6968
Location: porcelain throne

PostPosted: Thu Jan 07, 2010 8:26 am    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Jan 07, 2010 3:09 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us