I assume you are running this statement via ODBC, JDBC etc. which is why it defaults to the long names. I haven't tested this, but I think you have to specify the short names in your select statement rather than use *. You wouldn't need the AS clause. So, just SELECT FIELD1, FIELD2, etc..

Dean Eshleman
Software Development Architect

1110 North Main Street
PO Box 483
Goshen, IN 46527
(800) 348-7468 ext. 3528
(574) 533-9515 ext. 3528
[Join our Talent Network]<>

From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Richard Schoen
Sent: Wednesday, November 3, 2021 2:39 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: [EXTERNAL] Question on Long Column Names Returned from SQL Query. I Want Short Column Names

This email originated outside of Everence. Do not click links or attachments unless you recognize the sender.

I have a quick SQL question. Probably simple, but I can't seem to find an answer.

I have a table with long column names/alternate names and short system field names.

When I do a select * I would like to return the short system field name instead of the long column name.

In other words I want the short column names.

Q: Is there any way to return the short system field name rather than the alternate name without doing an AS for every field to rename it to the short name ?

Ex: On "select * from work" I am always getting ORDER_NUMBER. I want ORDER which is the short field name instead.

My code already uses the short field names and I can change the SQL to use AS if needed, but it would seem there should be a way other than using AS for each field name in the query.

Input appreciated.

Richard Schoen
Email: richard@xxxxxxxxxxxxxxxxx<mailto:richard@xxxxxxxxxxxxxxxxx<mailto:richard@xxxxxxxxxxxxxxxxx%3cmailto:richard@xxxxxxxxxxxxxxxxx>>

This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx>
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.

Help support by shopping at with our affiliate link:<>

Confidentiality Notice: This information is intended only for the individual or entity named. If you are not the intended recipient, do not use or disclose this information. If you received this e-mail in error, please delete or otherwise destroy it and contact us at (800) 348-7468 so we can take steps to avoid such transmission errors in the future. Thank you.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by 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.