View previous topic :: View next topic
|
Author |
Message |
CHANDAN KAPOOR
New User
Joined: 12 Apr 2008 Posts: 36 Location: NOIDA
|
|
|
|
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 |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
Column PTNOFITT does not exist in TE.UTE01011_ACFTDEFCT. Make sure you are referring to the table in the right region. |
|
Back to top |
|
|
CHANDAN KAPOOR
New User
Joined: 12 Apr 2008 Posts: 36 Location: NOIDA
|
|
|
|
I have checked the column PTNOFITT does exist in the table TE.UTE01011_ACFTDEFCT , Its throwing error for this column only . |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Its something to do with compiler options APOST , APOSTSQL |
|
Back to top |
|
|
CHANDAN KAPOOR
New User
Joined: 12 Apr 2008 Posts: 36 Location: NOIDA
|
|
|
|
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 |
|
|
Lijo
New User
Joined: 24 Aug 2008 Posts: 41 Location: Cochin
|
|
|
|
premkrishnan wrote:
Quote: |
Its something to do with compiler options APOST , APOSTSQL |
I couldn't link these options to this context .
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 |
|
|
CHANDAN KAPOOR
New User
Joined: 12 Apr 2008 Posts: 36 Location: NOIDA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
CHANDAN KAPOOR,
The processes (in order) are:- pre-compile
- compile
- link-edit
- 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
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
|