Need SQL help - UNION involving wide character columns

1 reply [Last post]
doug-doug the mighty's picture
Joined: Apr 14 2004
Posts: 1355

Is there any one out there that can help me with this?

I have a query in which I am trying to UNION three tables (all column names match from table to table) and some of the columns are wide character columns. Because this is not allowed, I am stuck on figuring out how to get around it. I have been beating myself over the head on this one and just cannot get it.

I would post the SQL, but it is so esoteric that there is no value in that. It really boils down to the question of how do I represent, in one SQL query, the contents of these three tables, where the results of any given row are always only ever sourced from a single table (I want all rows from all three tables) to create a sinlge view of the three.

The DBMS here is mainframe DB2 7.1, but therules on this should translate from DBMS to DBMS.

--DDTM

__________________

--DDTM ('Fritter Critter' since Apr 26 2004 - 18:16)

'If it ain't broke, take it apart anyways. If you can't take it apart, break it so that you can fix it.'

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
doug-doug the mighty's picture
Joined: Apr 14 2004
Posts: 1355
nevermind...

I figured it out...

The columns in question were VARCHAR, so I used the function CHAR( column_name , x ) where x = some length.

__________________

--DDTM ('Fritter Critter' since Apr 26 2004 - 18:16)

'If it ain't broke, take it apart anyways. If you can't take it apart, break it so that you can fix it.'