|
I am trying to use the SQLDA to dynamically create SQL statements. I am
getting the following error when running the program
Message ID . . . . . . : SQL0822
Severity . . . . . . . : 30
Message type . . . . . : Diagnostic
Date sent . . . . . . : 06/16/05
Time sent . . . . . . : 12:26:47
Message . . . . : Address in the SQLDA
not valid.
Cause . . . . . : The SQLDA contains
an address, SQLDATA value, or SQLIND
value in entry number 1 that is not
valid. The incorrect address or value
is type 1.
-- Type 1 indicates that the SQLDATA
address is not valid.
-- Type 2 indicates that the SQLIND
address is not valid.
-- Type 3 indicates that the SQLDA
address is not valid.
-- Type 4 indicates that the row
storage area is not large enough.
-- Type 5 indicates that the
indicator area for a blocked FETCH statement
is not large enough.
-- Type 6 indicates that the SQLDATA
field was not initialized to a value
in a REXX procedure
-- Type 7 indicates that the SQLIND
field was not initialized to a value
in a REXX procedure.
-- Type 8 indicates that the
SQLDATAL address is not valid.
Recovery . . . : For types 1, 2, 3,
or 8, change the address in entry 1 to
a valid address. For types 4 and 5,
allocate enough area for all of the rows
being requested. For types 6 and 7,
initialize the SQLDATA or SQLIND fields
to a valid value. Try the request
again.
Technical description . . . . . . . . :
When an SQLDA is used on FETCH,
OPEN, or EXECUTE, the address in each
SQLDATA entry in the SQLDA must be set
to a valid address. If the SQLTYPE
value indicates that an indicator
variable is also provided, the
corresponding SQLIND entry must contain a
valid address in addition to the
SQLDA being set to a valid address. In the
case of a REXX procedure, the SQLDATA
and SQLIND fields are not pointers,
but are buffers containing the
variable and indicator values. When an SQLDA
is used on an OPEN or EXECUTE, these
variables must be initialized to a
valid value.
So, I can tell that I have a problem
with the address in SQLDATA. I think the error is in reference to my
open statement. I assume I need to have an eval statement for the
SQLDATA, but I don't have a clue what to put there.... Here is a snippet
of my code. Any ideas of what I'm doing wrong? I've also tried it with
sqldabc = 1 * 80 + 16 and sqldabc = 2 * 80 + 16 for the second
occurance. Same error
C eval SQLN = 2
C eval SQLD = 2
C eval SQLTYPE =
452
C eval SQLLEN =
1
C eval SQLNAME =
'SAMPLE'
C eval sqldabc =
SQLN*80+16
C movea sqlvar
sql_var(1)
C eval SQLTYPE =
452
C eval SQLLEN =
1
C eval SQLNAME =
'SAMPLE1'
C eval sqldabc =
SQLN*80+16
C movea sqlvar
sql_var(2)
C/Exec SQL
C+ PREPARE SQL_Stmt FROM
:SQL_String
C/End-Exec
C/Exec SQL
C+ DECLARE SQL_Read SCROLL CURSOR
for SQL_Stmt
C/End-Exec
C/Exec SQL
C+ OPEN SQL_Read Using DESCRIPTOR
:SQLDA
C/End-Exec
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.