Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Assistance with an -804 SQLCODE

180 views
Skip to first unread message

Craig DeFranceschi

unread,
Jul 2, 1996, 3:00:00 AM7/2/96
to

While running a special version of an IMS/BMP with DB2 calls I received
an -804 SQLCODE 'SQLDA LENGTH INVALID'. From what I can recall, the
SQLDA (SQL Descriptor Area) comes into play only when dynamic SQL is
employed. This program contains nothing of the kind. Per the SQL
Messages and Codes manual, it also suggests that the improper use of a
working-storage variable can be a culprit. Again, there is nothing that
resembles this. I am using DB2/MVS V3 R1. Thanks in advance for your
help!

Craig DeFranceschi
EDS - People Systems Division
Southfield MI
EMAIL: LNUSPSD...@EDS.COM

sanja...@midata.com

unread,
Jul 2, 1996, 3:00:00 AM7/2/96
to

I have seen these errors when the INITIALIZE verb in COBOL is used to setup the data to be
inserted into the DB2 tables.

James A. Campbell

unread,
Jul 3, 1996, 3:00:00 AM7/3/96
to

In article <4rb436$q...@maverick.tad.eds.com>,

Craig DeFranceschi <LNUSPSD...@EDS.COM> wrote:
>While running a special version of an IMS/BMP with DB2 calls I received
>an -804 SQLCODE 'SQLDA LENGTH INVALID'. From what I can recall, the
>SQLDA (SQL Descriptor Area) comes into play only when dynamic SQL is
>employed.

No, the SQLDA is used to convey dynamic information between your program and
DB2. It could be used in static SQL like this
DECLARE FRED CURSOR FOR
SELECT NAME FROM SYSIBM.SYSTABLES
WHERE CREATOR = ?

appropriate initialisation
OPEN FRED USING DESCRIPTOR MY-SQLDA

appropriate initialisation
FETCH FRED USING DESCRIPTOR MY-SQLDA

it's just that *normally* one uses host-variables. In fact the parameter list
generated using host variables contains a mini-SQLDA - if you look carefully.

> This program contains nothing of the kind. Per the SQL
>Messages and Codes manual, it also suggests that the improper use of a
>working-storage variable can be a culprit. Again, there is nothing that
>resembles this. I am using DB2/MVS V3 R1. Thanks in advance for your
>help!

It is possible that what is really happening is that, if the host-variables
are passed as parameters to called modules, then the SQLDA/parameter-list
contains old addresses of the parameters. The code generated by the
pre-compiler for some languages (such as COBOL) will initialise these
addresses only during the first invokation of the program. On subsequent
invokations the parameter list contains the old addresses and "wonderfull"
things happen. To overcome this problem the Appl Prog & SQL Guide recommend
adding the (COBOL) statement
MOVE ZERO TO SQL-INIT-FLAG
to the start of your program. This will force the resetting of all the
SQLDA/param-list addresses during each invokation.


James Campbell
Telstra Corporation
jcam...@vitgsysa.telecom.com.au

Mark Fishman

unread,
Jul 3, 1996, 3:00:00 AM7/3/96
to

Craig DeFranceschi <LNUSPSD...@EDS.COM> wrote:

>While running a special version of an IMS/BMP with DB2 calls I received
>an -804 SQLCODE 'SQLDA LENGTH INVALID'. From what I can recall, the
>SQLDA (SQL Descriptor Area) comes into play only when dynamic SQL is

>employed. This program contains nothing of the kind. Per the SQL

>Messages and Codes manual, it also suggests that the improper use of a
>working-storage variable can be a culprit. Again, there is nothing that
>resembles this. I am using DB2/MVS V3 R1. Thanks in advance for your
>help!

>Craig DeFranceschi


>EDS - People Systems Division
>Southfield MI
>EMAIL: LNUSPSD...@EDS.COM

Everytime I have gotten an -804 error, it is due to the fact that
there is garbage data in one of the host variables. Maybe it is not
initialized.

0 new messages