الانتقال إلى المحتوى

Temp Table In Procedure ? How?


shamsoman

Recommended Posts


Hi there
You can create the temp tables as follows
CREATE GLOBAL TEMPORARY TABLE MIG2.MY_TEMP
(
id NUMBER,
DESC VARCHAR2(150)
)
ON COMMIT DELETE ROWS
NOCACHE;


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
such as

insert into my_temp
select eno,ename from scott.emp;

delete from my_temp where eno = 10
update my_temp
set sal= 1000
where eno = 10;

i hope this will answer youre question

رابط هذا التعليق
شارك

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية