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



Defining the variable as VARYING solved the problem.

Originally I fetched multiple rows with one statement. Changing that to single row fetch also solved the problem (even without changing the variable to VARYING).

SQLCODE is always 0. It is a nullable field but the null indicator is also 0.

So I can't explain it but now I have a good workaround.

Thanx

Mihael

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dennis Lovelady
Sent: Wednesday, May 05, 2010 11:24 AM
To: 'RPG programming on the IBM i / System i'
Subject: RE: Weird Embedded SQL Problem: getting x'20' in result variable

Most of the time the variable is filled correctly and is padded with
spaces (x'40'). But some times the variable is padded with x'20'
instead of x'40' and I got no clue why. The retrieved value though is
correct. Only the padded space is wrong.

We are on 6.1.

What is the value of SQLCOD at the time of this occurrence? What is the
result when you define your receiving field as varying length? Are
indicators involved in this query, and if so, what is the value of the
indicator associated with your VARCHAR field?

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"I knew I was an unwanted baby when I saw that my bath toys were a toaster
and a radio."
-- Joan Rivers




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.