Informix Temp Table, help needed
Posted in 2000
Topics: SQL Development & Query Writing
As I understand, you need to get rows from unrelated tables into one table and
process them later.
You have to use column aliasing to give columns names in temp table, i.e.
select tab1.col1 a1,tab1.col2 a2,tab1.col3 a3 from tab1
where ....
into temp temtab1 [with no log]
select tab2.col1 a1,tab2.col2 a2,tab2.col3 a3 from tab2
where ....
into temp temtab1 [with no log]
.
.
.
select a1,a2,a3 from temptab1 where a1 ...
As you can see, columns in temp table have names a1,a2,a3,....
First select statement creates temp table and determines columns type.
Hope this will help
Nebojsa Sevo
On Fri, 03 Nov 2000 03:46:37 -0600, lachlan Dunlop <lach@lach.net> wrote:
>Hello,
>
>I am trying to use informix temp tables. I am having a hard time
>finding information on how to implement them.
>
>I have multiple seemingly unrelated select statements, which I want the
>results to go into 1 row of a temp table. Can this be done with
>Informix?
>
>How would I have Informix create this for me?
>
>Thanks
>
>Lach
Hello, I am trying to use informix temp tables. I am having a hard time finding information on how to implement them. I have multiple seemingly unrelated select statements, which I want the results to go into 1 row of a temp table. Can this be done with Informix? How would I have Informix create this for me? Thanks Lach
Sory, it shoud lokk like this:
select tab1.col1 a1,tab1.col2 a2,tab1.col3 a3 from tab1
where ....
into temp temptab1 [with no log]
insert into temptab1
select tab2.col1 a1,tab2.col2 a2,tab2.col3 a3 from tab2
where ....
insert into temptab1
select tab3.col1 a1,tab3.col2 a2,tab3.col3 a3 from tab3
where .... .
.
.
.
select a1,a2,a3 from temptab1 where a1 ...
Nebojsa
On Fri, 03 Nov 2000 08:36:21 +0100, Nebojsa Sevo <mips@zg.tel.hr> wrote:
>As I understand, you need to get rows from unrelated tables into one table and
>process them later.
>You have to use column aliasing to give columns names in temp table, i.e.
>
> select tab1.col1 a1,tab1.col2 a2,tab1.col3 a3 from tab1
> where ....
> into temp temtab1 [with no log]
>
> select tab2.col1 a1,tab2.col2 a2,tab2.col3 a3 from tab2
> where ....
> into temp temtab1 [with no log]
>
> .
> .
> .
> select a1,a2,a3 from temptab1 where a1 ...>
>As you can see, columns in temp table have names a1,a2,a3,....
>First select statement creates temp table and determines columns type.
>
>Hope this will help
>
>Nebojsa Sevo
>On Fri, 03 Nov 2000 03:46:37 -0600, lachlan Dunlop <lach@lach.net> wrote:
>
>>Hello,
>>
>>I am trying to use informix temp tables. I am having a hard time
>>finding information on how to implement them.
>>
>>I have multiple seemingly unrelated select statements, which I want the
>>results to go into 1 row of a temp table. Can this be done with
>>Informix?
>>
>>How would I have Informix create this for me?
>>
>>Thanks
>>
>>Lach