× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm trying to use the following multi-row fetch in an embedded SQL
program on V5R2:


d fm s 30a dim(300)
d sql_num c const(300)




c/exec sql
c+ include sqlda
c/end-exec

c/exec sql
c+ declare c1 cursor for
c+ select formidcf
c+ from formtabl01
c/end-exec

c/exec sql
c+ open c1
c/end-exec

c/exec sql
c+ fetch c1 for 300 rows
c+ using descriptor :sqlda into :fm
c/end-exec

c/exec sql
c+ close c1
c/end-exec




The program compiles just fine, but when it runs I receive sqlcod =
-804, sqlstt = 07002 on the fetch statement.

Message Text: SQLDA not valid.
Cause Text: If the error type is 2, 3 or 9, the entry in error is &2,
the value of SQLTYPE is &3, and the value of SQLLEN or SQLLONGLEN is
&4. The specified SQLDA is not valid because of error type &1. Error
types and their meanings are:

* 1 -- The value of SQLN is less than zero, the value of SQLD is
not between 0 and 8000, the value of SQLD is greater than the value of
SQLN, or that the value of SQLD has not been initialized in REXX.
* 2 -- The value of SQLTYPE is not valid or that the value of
SQLTYPE is not supported or has not been initialized in REXX. The
types that are not supported in REXX are NUL-terminated graphic
string, NUL-terminated character string, PASCAL L-string, sign leading
separate, and binary with precision and scale.
* 3 -- The value of SQLLEN or SQLLONGLEN is not valid or that the
value of SQLLEN, SQLPRECISION, or SQLSCALE has not been initialized in
REXX. If REXX and SQLTYPE is decimal or numeric, then either
SQLPRECISION or SQLSCALE has not been initialized. Otherwise, SQLLEN
has not been initialized. If SQLTYPE is a LOB variable, then
SQLLONGLEN is not valid.
* 4 -- Size of the SQLDA area was not large enough for the number
of entries specified in SQLN statement.
* 5 -- The SQLDA area was not on a 16-byte boundary.
* 6 -- The value specified for SQLDABC is not valid. The value is
either not large enough for the number of entries specified in SQLN or
the value is greater than the maximum allowed.
* 7 -- The value of SQLN was not at least twice the size of SQLD
and LOB host variables were found in the SQLDA.
* 8 -- The seventh byte of SQLDAID was not a '2', '3' or '4' and
LOB host variables were found in the SQLDA.
* 9 -- The SQLDATAL pointer was not null for a DBCLOB host
variable, but the length value referenced by the SQLDATAL pointer had
an odd value.
* 10 -- The SQLTYPE for a LOB locator did not match the type
associated with LOB locator.
* 11 -- The row length is greater than the maximum allowed row length.


The information from the info center is not exactly helpful. Where is
the error type that it talks about? The SQLTYPE = 6448 and SQLLEN =
6448 after the open. SQLLONGLEN does not exist according to debug.

Gene

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.