Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Informix Temp Table, help needed

360 views
Skip to first unread message

lachlan Dunlop

unread,
Nov 3, 2000, 4:46:37 AM11/3/00
to
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

mark's news

unread,
Nov 2, 2000, 5:56:27 PM11/2/00
to
do your select statement but at the end you use the
clause "into temp [temp table name]
i.e 'select * from tab1.... into temp save1'

you can then select from the table save1.
The table will be deleted when you sqlexec session ends

lachlan Dunlop wrote in message <3A02897D...@lach.net>...

Nebojsa Sevo

unread,
Nov 3, 2000, 2:36:21 AM11/3/00
to
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

Nebojsa Sevo

unread,
Nov 3, 2000, 8:01:45 AM11/3/00
to
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

Luis Carlos Diaz Otero

unread,
Nov 3, 2000, 9:08:03 AM11/3/00
to

SELECT column_list
FROM table_list
WHERE conditions_list
INTO TEMP temp_table_name ?????


--- lachlan Dunlop <la...@lach.net> escribió: > 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
>


=====
______________________________________Luis Carlos Díaz OteroALCANOS DE COLOMBIA S.A. E.S.PCarrera 9 # 7-25Neiva (Huila (Colombia))

_________________________________________________________
Do You Yahoo!?
Obtenga su dirección de correo-e gratis @yahoo.com
en http://correo.espanol.yahoo.com

dgm...@my-deja.com

unread,
Nov 3, 2000, 10:14:20 AM11/3/00
to
CREATE TEMP TABLE temp_table_name (
column1 type,
column2 type,
...
);

Then use standard insert and update statements to the table as if it
where a normal table.


In article <8tuh96$ai9$1...@news.xmission.com>,
=?iso-8859-1?q?Luis=20Carlos=20Diaz=20Otero?=


Sent via Deja.com http://www.deja.com/
Before you buy.

0 new messages