Ah, that makes sense... Casting from literal wants to become Varchar. This is exactly the situation I had when I first saw the varchar issue.
Thanks for the clarification!
Eric
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Scott Klement
Sent: Monday, October 01, 2007 5:58 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: SQL CLI Parameter Value Issue
Hi Eric,
DeLong, Eric wrote:
Not absolutely sure, but I recall having problems making stored
procedure calls to RPG when using SQL CHAR types. I think SQL wants
us to use VARCHAR types for all character parms....
If the error was "procedure not found" then I might agree with you that
the data types in his program don't match the data types of the
procedure itself. However, since he's not getting an error, but the
parameter data is being changed, I have to assume that it's something else.
Normally the CHAR vs. VARCHAR stuff manifests itself when you code the
parameter directly into your SQL statement. Something like this:
SqlStmt = 'CALL MYPROC(''ParmOne'',''ParmTwo'')';
In this SQL statement, I coded character parameters directly into the
statement instead of using parameter markers. The problem is, SQL will
interpret these character parms as VARCHAR, so if my CREATE PROCEDURE
statement used type CHAR, it won't match the procedure definitions, and
because of overloading, I'd get a "procedure not found" error.
However, in Arturo's example, he used parameter markers, and
SQLBindPArameter() explicitly told the SQL engine what the data type of
each parameter will be (both in the program, and in the SQL side of
things, so the system can convert between them!). So this really
shouldn't provoke the same sort of error...
As an Amazon Associate we earn from qualifying purchases.