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



After reading Gina Whitney's article that Charles pointed at I checked the
documentation again (overlooked the reference the first time) and it is
documented in the RPG Reference: "Note: If the alternate name for a
particular external field is enclosed in quotes, the standard external
field name is used for that field."

Joep Beckeringh




From:
J.Beckeringh@xxxxxxxxxxxxxxxxxxxxxxxxxx
To:
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
Date:
10-10-2011 11:29
Subject:
Re: AW: Referencing SQL Table Alternative Names in a RPG module



Hello Birgitta,

Just did a test on 7.1: If I specify a quoted alias, the RPG compiler uses

the system name.

So when I specify the column as 'Longdescription for column long ...', RPG

uses LONGDESCRIPTION.
But when I specfify '"Longdescription" for column long ...' RPG uses LONG.

I assume the RPG compiler cannot handle names that contain quotes and
sadly you can't get rid of the quotes that you need to force SQL to honour

mixed case names.

Joep Beckeringh



From:
"Birgitta Hauser" <Hauser@xxxxxxxxxxxxxxx>
To:
"'RPG programming on the IBM i / System i'" <rpg400-l@xxxxxxxxxxxx>
Date:
09-10-2011 12:31
Subject:
AW: Referencing SQL Table Alternative Names in a RPG module



Barbara,

just a question.
In SQL tables it is possible to define columns with "case sensitive" and
"invalid" names, for example "My New Column" or "BugetPrice" or even
"Änderungs-Datum".
Is it possible to handle those column names when specifying the keyword
ALIAS?

(I'd try it, but I've currently no access to an i-Series with release 7.1)


Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
Im
Auftrag von Barbara Morris
Gesendet: Friday, 07. October 2011 20:36
An: rpg400-l@xxxxxxxxxxxx
Betreff: Re: Referencing SQL Table Alternative Names in a RPG module

On 2011/10/7 1:19 PM, Andy Hautamaki wrote:
In an SQL Table we have descriptive alternative field names that from
what I can see from prior posts you can't refer to them in an RPG
module. (Not using embedded SQL)

In the compile listing for the externally defined file I notice it
doesn't bring them in for the record format so I get the fields not
defined compile error.

Is this just how things are and not something that is even on the radar
to change?


In V7R1, you can specify ALIAS on the D spec of an externally-described
DS and then the subfields will have the alternate names instead of the
short names.

You can also specify ALIAS on an F spec of any file that won't have I
and O specs generated by the compiler (no I/O specs if you specify
QUALIFIED, LIKEFILE, or define the file in a subprocedure). Then, if you
define a data structure using LIKEREC of one of the file's formats, the
subfields will get the alternate names.

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.