Johnson, Shaunn wrote:
select / create a pseudo field

Howdy:

Connecting to DB2 OS/390 6.1.2.
 
Isn't there a way to create a fake field / value from DB2
when selecting from a table?

For example, in Oracle I can do something like this:

[snip example]
SELECT
C_TYPE_SERVICE AS TYPESERV,
** NULL AS IPA_NUM, **
D_CURR_EFF_DT AS PCPFROM,
D_CURR_END_DT AS PCPTO
FROM T_TABLE
;
[/snip example]

In the above, IPA_NUM is a new column with a null
value - but what I want to do is something like:

[snip example]
SELECT
C_TYPE_SERVICE AS TYPESERV,
** '04' AS BU, **
D_CURR_EFF_DT AS PCPFROM,
D_CURR_END_DT AS PCPTO
FROM T_TABLE
;
[/snip example]

Where I create a numerical (or even text) value and assign it to a new column
called 'BU'.

Is this possible?  This example above doesn't work for me in DB2.

Thanks!

-X

Hi Shaunn,

I;m not sure if your typing the askerisks. Try leaving them out.
db2 "select manager, '04' as BU from org"

MANAGER BU
------- --
             160 04
              50 04
              10 04
              30 04
            100 04
            140 04
            270 04
            290 04
  8 record(s) selected.

HTH
Leo Flores

Reply via email to