I think you can use CAST to make all the fields the same length.
Scott
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Stone, Joel
Sent: Thursday, July 26, 2012 4:11 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: can I set up a multi-format logical file in DDS with
onekeyfield having a default fixed value?
But doesn't this require all field attributes to be identical? I don't
have that - fields have varying lengths.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Mildenberger
Sent: Thursday, July 26, 2012 4:13 PM
To: Midrange Systems Technical Discussion
Subject: RE: can I set up a multi-format logical file in DDS with one
keyfield having a default fixed value?
This makes me think of what I did just yesterday, the SQL experts here
will know if this could be incorporated into a CREATE INDEX or CREATE
VIEW, if so I think this would create exactly what the OP was looking
for because the table created had a new field 'type' that had hard-coded
values depending on which part of the union they came from.
I did this, the UNION ALL was from the same file but didn't have to be
and I hard-coded a value from each select to distinguish them:
select cnunit, expiredate, type from table(
SELECT cnunit, cnwcmpdate as expiredate, 'Work Comp' as type
FROM trucklib.contract
UNION ALL
SELECT cnunit, add_months(cntsadate, 24) as expiredate, 'TSA' as
type FROM trucklib.contract)
as z where (days(expiredate) - days(curdate()) < 90) order by
expiredate
Scott
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: Thursday, July 26, 2012 3:00 PM
To: Midrange Systems Technical Discussion
Subject: Re: can I set up a multi-format logical file in DDS with one
keyfield having a default fixed value?
He doesn't want a join, he wants a UNION ALL...
Vertical, not horizontal :)
Charles
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
________________________________________________________________________
This inbound email has been scanned for all viruses by the MessageLabs
SkyScan
service.
________________________________________________________________________
______________________________________________________________________
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.