× 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.



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.

This thread ...

Replies:

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.