473,394 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

7.2 to 8.1 DB2 migration problems

Hi All.

After moving to new version of DB2 we faced with strange problem - code that
worked fine with DB2 v7.2.x on DB2 v 8.1 sometimes write error message like
the:

===message===
SQLCODE : -804
SQL0804N The application program parameters for the
current request are not valid. Reason code "107". If a
host variable or SQLVAR in the SQLDA is invalid then: host
variable/SQLVAR number = "6", SQLTYPE = "481", SQLLEN = "8",
host variable/SQLVAR type = "OUTPUT". SQLSTATE=07002
===message===

That code (written on C) is responsible for executing dynamic SQLs.
In general it looks like the:

EXEC SQL PREPARE sql_szExecStmt FROM :sql_szSqlStmt;
// [...]
EXEC SQL DESCRIBE sql_szExecStmt INTO :*SqlDaOut;
// [...]
EXEC SQL DECLARE sql_szExecCursor CURSOR FOR sql_szExecStmt;
// [...]
EXEC SQL OPEN sql_szExecCursor;
// line below is the source of mentioned error ...
EXEC SQL FETCH sql_szExecCursor USING DESCRIPTOR :*SqlDaOut;
// [...]
EXEC SQL CLOSE sql_szExecCursor;

Could you please share some of your experience - what could be the reason of
this error?
Why it worked find on previous version of DB2?
How we can fix it?

With regards,
Dmitry.
Nov 12 '05 #1
3 4572
Dmitry Bond wrote:
Hi All.

After moving to new version of DB2 we faced with strange problem - code that
worked fine with DB2 v7.2.x on DB2 v 8.1 sometimes write error message like
the:

===message===
SQLCODE : -804
SQL0804N The application program parameters for the
current request are not valid. Reason code "107". If a
host variable or SQLVAR in the SQLDA is invalid then: host
variable/SQLVAR number = "6", SQLTYPE = "481", SQLLEN = "8",
host variable/SQLVAR type = "OUTPUT". SQLSTATE=07002
===message===

That code (written on C) is responsible for executing dynamic SQLs.
In general it looks like the:

EXEC SQL PREPARE sql_szExecStmt FROM :sql_szSqlStmt;
// [...]
EXEC SQL DESCRIBE sql_szExecStmt INTO :*SqlDaOut;
// [...]
EXEC SQL DECLARE sql_szExecCursor CURSOR FOR sql_szExecStmt;
// [...]
EXEC SQL OPEN sql_szExecCursor;
// line below is the source of mentioned error ...
EXEC SQL FETCH sql_szExecCursor USING DESCRIPTOR :*SqlDaOut;
// [...]
EXEC SQL CLOSE sql_szExecCursor;

Could you please share some of your experience - what could be the reason of
this error?
Why it worked find on previous version of DB2?
How we can fix it?

With regards,
Dmitry.

Well it seems to think that your output SQLDA for variable #6 is not set
up properly.
There has been major work in DRDA for V8. It could be that DB2 checks
for a field you coule get away with in the past.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
http://publib.boulder.ibm.com/infoce...30%34%4e%22%20
Version 8 incompatibilities with previous releases
Change
If a host variable is not declared in the BEGIN DECLARE section and is used
in the EXEC SQL section, SQL0306N will not be returned by the precompiler.
If the variable is declared elsewhere in the application, application
runtime will return SQL0804N. If the variable is not declared anywhere in
the application, the compiler will return an error at compilation time.

Symptom
Applications coded to react to an SQL0306N error at precompilation time may
not behave as before.

Resolution
Host variables should be declared in the BEGIN DECLARE section. If host
variables are declared in a section other than the BEGIN DECLARE section,
you should recode your application to handle SQL0804 return codes.

Does the shoe fit?

PM

"Dmitry Bond" <di******@mail.ru> a écrit dans le message de
news:10***************@moxa.united.net.ua...
Hi All.

After moving to new version of DB2 we faced with strange problem - code that worked fine with DB2 v7.2.x on DB2 v 8.1 sometimes write error message like the:

===message===
SQLCODE : -804
SQL0804N The application program parameters for the
current request are not valid. Reason code "107". If a
host variable or SQLVAR in the SQLDA is invalid then: host
variable/SQLVAR number = "6", SQLTYPE = "481", SQLLEN = "8",
host variable/SQLVAR type = "OUTPUT". SQLSTATE=07002
===message===

That code (written on C) is responsible for executing dynamic SQLs.
In general it looks like the:

EXEC SQL PREPARE sql_szExecStmt FROM :sql_szSqlStmt;
// [...]
EXEC SQL DESCRIBE sql_szExecStmt INTO :*SqlDaOut;
// [...]
EXEC SQL DECLARE sql_szExecCursor CURSOR FOR sql_szExecStmt;
// [...]
EXEC SQL OPEN sql_szExecCursor;
// line below is the source of mentioned error ...
EXEC SQL FETCH sql_szExecCursor USING DESCRIPTOR :*SqlDaOut;
// [...]
EXEC SQL CLOSE sql_szExecCursor;

Could you please share some of your experience - what could be the reason of this error?
Why it worked find on previous version of DB2?
How we can fix it?

With regards,
Dmitry.

Nov 12 '05 #3
Hello.

Thank you (and Serge Rielau too) for answers. :-)

I found where problem was.
There was not initialized Null-indicator pointer (I mean -
SqlDaOut->sqlvar[i].sqlind, there was zero).
The columns 2 and 6 (specified in the error message) is the exactly columns
where the NULL value could occurs.
After I fixed this the problem disappeared. Seems it working fine now.

With regards,
Dmitry.

"PM (pm3iinc-nospam)" <PM(pm3iinc-nospam)@sympatico.ca> wrote in message
news:X9*******************@news20.bellglobal.com.. .
http://publib.boulder.ibm.com/infoce...30%34%4e%22%20 Version 8 incompatibilities with previous releases
Change
If a host variable is not declared in the BEGIN DECLARE section and is used in the EXEC SQL section, SQL0306N will not be returned by the precompiler.
If the variable is declared elsewhere in the application, application
runtime will return SQL0804N. If the variable is not declared anywhere in
the application, the compiler will return an error at compilation time. [...] Does the shoe fit?

PM

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
1
by: ss_dash | last post by:
Hi all, I am using the Oracle Workbench for migrating my DB currently on Sql Server 2000 to Oracle 9i. During the migration the following happens SELECT @tBaseTable = tBaseTable,...
11
by: Jep | last post by:
Any help or advice appreciated. We have just installed and configured a new DB2 v.8.1 with latest FixPack. Just a few days later it dies and now we have a DB that is totally unusable. - - - -...
4
by: Abram Friesen | last post by:
Hi, I'm a developer for a software application vendor, and our application makes use of a customer-maintained Oracle 8i/9i database. We've had a customer request to support DB2 database, and I'm...
1
by: Henry Reardon | last post by:
I'm having some migration problems. On Friday, I upgraded from DB2 7.2 (FP9) to DB2 8.2 (FP7), then applied Fixpack 8. I'm running Windows XP. My migrations did not work and I am trying to fix...
0
by: Henry Reardon | last post by:
I need some help with migration. As I mentioned in my previous post, I am having migration problems after updating DB2 7.2 to DB2 8.2 and then applying FP8. I am running on Windows XP. None...
2
by: aww91 | last post by:
Company is planning a Sybase to UDB migration that is projected to take 1 year. During that long period of time any Code Freeze put into place would impact our users (we normally release code...
1
by: Bonggoy Cruz | last post by:
We have a fairly big size ASP.NET web application that was written VB.NET. We are in the process converting the web project. We used the migration wizard included in VS 2005. I followed step by...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
0
by: SenthilVel | last post by:
Hi All I have problems when i convert my 1.1 ASPX web application to 2.0 using VS2005. My web application gets compiled fine in CLR1.1 and there is no problem with that. When i do the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.