Craig DeFranceschi
EDS - People Systems Division
Southfield MI
EMAIL: LNUSPSD...@EDS.COM
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
>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.