Re: Temporary table and virtual column
Posted in 1998
This is a multi-part message in MIME format.
--------------1FBADE091296CEE1E9D71F81
Content-Type: text/plain; charset=us-ascii
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit
Ian Clark wrote:
> Hi All,
>
> Take a look at the following statements written into a 4GL program:
>
> SELECT field1, field2, "TR" FROM table1 WHERE some_conditions1
> UNION
> SELECT field1, field2, "SH" FROM table1 WHERE some_conditions2
> INTO TEMP temp_table
I think you get error code -249: Vitual column must have explicit name.
To solve the problem use display labels to name the vitual columns:
SELECT field1, field2, "TR" virtual_col FROM table1 WHEREsome_conditions1
UNION
SELECT field1, field2, "SH" virtual_col FROM table1 WHEREsome_conditions2
INTO TEMP temp_table
In the example 'virtual_col' is a display label
good luck
claus
>
>
> This doesn't go down to well with the compiler since the virtual
> column of static values I want to insert cannot be achieved unless I
> somehow have a column name too.
> Replacing the above with this;
>
> SELECT field1, field2, field3 "TR" FROM table1 WHERE some_conditions1
> UNION
> SELECT field1, field2, field3 "SH" FROM table1 WHERE some_conditions2
> INTO TEMP temp_table>
> yields more error messages. I am not sure where to go from here. For
> simplicity I would like to perform the SELECT and creation of the
> temporary table in one go but if I can't, how can I achieve what I
> want.
>
> Any help would be very much appreciated.
>
> Cheers, Ian.
--------------1FBADE091296CEE1E9D71F81
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Claus Samuelsen
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Claus Samuelsen
n: Samuelsen;Claus
org: Avenir Danmark A/S
adr: Gydevang 22 B;;;DK-3450 Aller'd;;;Denmark
email;internet: csa@sysdeco.dk
title: Systems Manager
tel;work: +45 4814 3000
tel;fax: +45 4814 3011
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
end: vcard
--------------1FBADE091296CEE1E9D71F81--