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



Hi Joel

I don't think that a QMQRY will give you column headings the way you want in an outfile - unless that outfile already exists and has them defined. The column headings in a QM form are only for that - you can have up to 9 rows of them, each of some length I can't remember. But that would not be the column headings that are done with the COLHDG keyword in DDS or with LABEL ON in DDL.

Maybe if you create a table using a SELECT statement WITH NO DATA, and the table in the FROM clause has column headings, those would come along to the new table. Might be worth a try.

Good luck
Vern

On 12/11/2015 4:24 PM, Stone, Joel wrote:
Thanks Vern and Chuck.

I should have explained the situation better.

I am using QMQRY to an *OUTFILE.

So the easiest method may be to have a second QMQRY to do the "Label On" to define the colhdg values.

Is it possible to do this in one QMQRY source file? No biggie to add a second QMQRY run, but I was hoping that I could get away with something as simple as using the word "AS" to rename the field, hoping I could use "Label On" in the select statement somehow to define the colhdg.

Thanks



-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Vernon Hamberg
Sent: Thursday, December 10, 2015 5:00 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: SQL: How to change *COLHDG to include spaces between words

Joel

That's not a column heading, it's an alias name - and with the lack of a
real column heading and no column text, the system uses the name as the
column heading.

You could make a temp table (declare global temporary table) and do
LABEL ON column-name is 'Net Bus/Lbs' - be sure that in the value that
you honor the 20-character segments - column headings can be 60 long and
are made of 3 20-char segments.

You can get column headings, even long ones, using Query Management
forms - but this is a reporting tool - things like the SEQUEL product
and Web Query and Query/400 (old name) will give you the option, but
nothing I know of in native SQL.

SEQUEL has the ability to specify edit codes and edit words and column
headings, at least, in their proprietary SELECT statement - can be
pretty cool for what you're doing. Available at Help Systems - maybe see
if y'all have it at your place.

HTH
Vern

On 12/10/2015 4:36 PM, Stone, Joel wrote:
I would like to add a col hdg to an SQL field in a select statement:


q.A0182_PRICED_QTY as "Net Bus/Lbs"



Unfortunately the iseries SQL engine creates the field with a column heading which actually contains the double-quotes.

Is it possible to have spaces in the colhdg as one would expect, but not include any quote characters?

Thanks in advance!

______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs Skyscan service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


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.