|
Joel - Here's an example: CREATE TABLE AUSLMPLIB/TEMP (LONG_FIELD_NAME FOR COLUMN SHORT1 CHARACTER (10 ) NOT NULL WITH DEFAULT) Table TEMP in AUSLMPLIB created but could not be journaled. The field SHORT1 is available in the RPG program...you can use either: SELECT LONG_FIELD_NAME FROM auslmplib/temp or SELECT short1 FROM auslmplib/temp in an SQL statement. Steve ----- Original Message ----- From: <Rick.Chevalier@xxxxxxxxxxxxxxx> To: <rpg400-l@xxxxxxxxxxxx> Sent: Thursday, August 19, 2004 2:46 PM Subject: RE: Long SQL Field Names > Joel, > > You might try using an alias. It's been a while since I had this issue but IIRC that's how I solved it. I don't have time right now to create a file to test it, sorry. > > HTH, > > Rick > > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Joel Cochran > Sent: Thursday, August 19, 2004 10:39 AM > To: RPG programming on the AS400 / iSeries > Subject: Long SQL Field Names > > > I have an SQL created file with long field name. It also has shorter > system names for the fields. I have an SQL statement in an RPG program > that is trying to use the long field name, but I get a compile error > saying the column is not in the table. > > Here is the CREATE TABLE statement... > > create table brmajobs.Assessors > ( assessor_id for inspector int not null , > assessor_initials for inits char(50) not null , > assessor_name for name char(50) not null , > last_change_user for chgUser char(10) not null , > last_change_timestamp for chgStamp timestamp not null with default , > Primary Key( assessor_id ) > ); > > And here is the DSPFFD for the first field: > > Field Level Information > Data Field Buffer Buffer Field > Column > Field Type Length Length Position Usage > Heading > INSPECTOR BINARY 9 0 4 1 Both > Assessor ID > Field text . . . . . . . . . . . . . . . : Assessor ID > Alternative name . . . . . . . . . . . . : ASSESSOR_ID > Default value . . . . . . . . . . . . . . : None > > > I can use the field name "assessor_id" in STRSQL, but not in the > SQLRPGLE module. Is there a compiler option I have to set to use the > long names or do I have to use the shorter system name in programs? > > Joel > http://www.rpgnext.com > > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > >
As an Amazon Associate we earn from qualifying purchases.
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.