I forgot to add TEXT on the descriptive text part:

LABEL ON COLUMN SCHOOL TEXT IS 'Elementary school district 535 rocks the
house'

2007 System i Fall Technical Conference | Orlando | November 4-7
Celebrating 10-Years of SQL Performance Excellence on IBM i5/OS and OS/400

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Elvis Budimlic
Sent: Tuesday, October 23, 2007 10:40 AM
To: 'Midrange Systems Technical Discussion'
Subject: RE: Using SELECT AS to Create Column Heading

Column heading is actually a LABEL in SQL terminology. So after you create
a table, you'd do something like:

LABEL ON COLUMN SCHOOL IS 'Elementary School District
535'

Notice that you can have up to 3 rows of column heading as each row will
hold up to 20 characters worth of data.

You can also add up to 50 characters descriptive text to the column by
another LABEL command, for example:

LABEL ON COLUMN SCHOOL IS 'Elementary school district 535 rocks the house'

I wouldn't use QMQRYs for this type of DDL work since it doesn't permit for
running multiple statements within the same source (well, I guess you can
use QM procedures but...).
RUNSQLSTM on the other hand allows for multiple statements in the same
source, separating them with semicolons.

HTH

Elvis

2007 System i Fall Technical Conference | Orlando | November 4-7
Celebrating 10-Years of SQL Performance Excellence on IBM i5/OS and OS/400

-----Original Message-----
Subject: Using SELECT AS to Create Column Heading

Can someone tell me is it is possible to use SELECT AS in a QMQRY to
generate multi-word column headings without getting the double quotes as
part of the heading?

Here's the SQL stmt:
select a.stschl as SCHOOL,
a.stgrd as GRADE,
a.sthmrm as HOMEROOM,
c.empin as "TEACHER ID",

When run DSPFFD the double quotes are part of the column heading?

Thank you, Bob


This thread ...

Replies:

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

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