Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with VARCHAR, NVARCHAR

Status
Not open for further replies.

gtthannover

Programmer
Dec 17, 2003
2
DE
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top