Re: Temporary table and virtual column
Posted in 1998
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
Try this:
SELECT field1, field2, "TR" any_label FROM table1 WHERE some_conditions1
UNION
SELECT field1, field2, "SH" any_label FROM table1 WHERE some_conditions2
INTO TEMP temp_table
> 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.
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
Mail: Peter.Lancashire.PL1@bayer.co.uk
---
My Internet plumbing does not allow me to mail and post news together.
Sorry.
All opinions are my own and not those of Bayer plc.
---
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/