gtthannover
Programmer
Hi,
I have to build an DB2 - Interface for an existing software-package.
We use dynamic SQL, describing the SQL- Statements into the sqlda-Structure.
After FETCH we use the sqlda->sqlvar.sqldata directly.
If we get VARCHAR or NVARCHAR-Fields from the database, we only identify the
Length of the string not the string itself.
When I set the VARCHAR –type to Char before FETCH, the sqlvar.sqldata
is identified correctly.
This doesn’t work for the NVARCHAR-Type. If I try to change this type I always get
The following error-message:
---- error report -----------------------------
application message = Fetch Statement
line = 225
file = dynseltest.sqc
SQLCODE = -804
SQL0804N Die Parameter des Anwendungsprogramms für die aktuelle Anforderung
sind ungültig. Ursachencode: "107". Bei einer ungültigen Host-Variablen oder
SQLVAR im SQL-Deskriptorbereich gilt folgendes: Host-Variable/SQLVAR-Nummer=
"2", SQLTYPE = "461", SQLLEN = "10", Host-Variable/SQLVAR-Art = "OUTPUT".
SQLSTATE=07002
SQLSTATE 07002: Die Liste der Aufrufparameter oder ein Steuerblock ist
ungültig.
---- end error report ------------------------
Does anybody know a trick how to convert this datatypes automatically? Or is there another solution for this problem?
Thanks in advance
Gabriele Eichler
I have to build an DB2 - Interface for an existing software-package.
We use dynamic SQL, describing the SQL- Statements into the sqlda-Structure.
After FETCH we use the sqlda->sqlvar.sqldata directly.
If we get VARCHAR or NVARCHAR-Fields from the database, we only identify the
Length of the string not the string itself.
When I set the VARCHAR –type to Char before FETCH, the sqlvar.sqldata
is identified correctly.
This doesn’t work for the NVARCHAR-Type. If I try to change this type I always get
The following error-message:
---- error report -----------------------------
application message = Fetch Statement
line = 225
file = dynseltest.sqc
SQLCODE = -804
SQL0804N Die Parameter des Anwendungsprogramms für die aktuelle Anforderung
sind ungültig. Ursachencode: "107". Bei einer ungültigen Host-Variablen oder
SQLVAR im SQL-Deskriptorbereich gilt folgendes: Host-Variable/SQLVAR-Nummer=
"2", SQLTYPE = "461", SQLLEN = "10", Host-Variable/SQLVAR-Art = "OUTPUT".
SQLSTATE=07002
SQLSTATE 07002: Die Liste der Aufrufparameter oder ein Steuerblock ist
ungültig.
---- end error report ------------------------
Does anybody know a trick how to convert this datatypes automatically? Or is there another solution for this problem?
Thanks in advance
Gabriele Eichler