Temp Table In Procedure ? How?
تاريخ المشاركة 27 August 2008 - 10:41 AM
You can create the temp tables as follows
CREATE GLOBAL TEMPORARY TABLE MIG2.MY_TEMP
ON COMMIT DELETE ROWS
and after you create it, it becom an object on the database, that one of its property on commit will delete all data in it, or when the session ends it will also delete the data, and its session dependant, means that defferent sessions cant share that data wich is stored in the temp table,
how to use it?
it can be used as any other table select from it, insert to it, delete from it, and also create index on columns on it
insert into my_temp
select eno,ename from scott.emp;
delete from my_temp where eno = 10
set sal= 1000
where eno = 10;
i hope this will answer youre question