Home » Other » Client Tools » Most Most Most urgent help need about temporary table and matrix reps
Most Most Most urgent help need about temporary table and matrix reps [message #25935] Tue, 27 May 2003 17:36 Go to next message
Muhammad Aurangzaib
Messages: 43
Registered: April 2003
Member
salam

I have a problem, wants to get urgent ans.

i make a temporary table as and make a procedures with seqance of

1 create global temporary table temp_table (
2 dname varchar2(30),
3 job varchar2(30))
4* on commit preserve rows
SQL> /

Table created.

SQL> create or replace procedure temp_proc as
2 cursor c1 is select dname,job from emp e,dept d
3 where d.deptno = e.deptno;
4 begin
5 for rec in c1 loop
6 insert into temp_table values(rec.dname,rec.job);
7 end loop;
8 end;
9 /

Procedure created.

SQL> select * from temp_table;

no rows selected

SQL> execute temp_proc;

PL/SQL procedure successfully completed.

SQL> /

DNAME JOB
------------------------------ ------------------------------
RESEARCH CLERK
SALES SALESMAN
SALES SALESMAN
RESEARCH MANAGER
SALES SALESMAN
SALES MANAGER
ACCOUNTING MANAGER
RESEARCH ANALYST
ACCOUNTING PRESIDENT
SALES SALESMAN
RESEARCH CLERK

DNAME JOB
------------------------------ ------------------------------
SALES CLERK
RESEARCH ANALYST
ACCOUNTING CLERK

14 rows selected.

SQL> commit;

Commit complete.

Now i wants a matrix report with side rows are dname and matrix cell will be job...

but problem is temporary table... as I leave a session data disappear....

what i do.... please I need very very very urgent solation... with in few mins...
thx a lots
Re: Most Most Most urgent help need about temporary table and matrix reps [message #25936 is a reply to message #25935] Tue, 27 May 2003 17:50 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Well, a global temporary table is just that - temporary. Any remaining data at the end of the session is deleted automatically. If you want persistant data across sessions, you'll need to use a "regular" non-temporary table.
Re: Most Most Most urgent help need about temporary table and matrix reps [message #25937 is a reply to message #25936] Tue, 27 May 2003 17:56 Go to previous messageGo to next message
Muhammad Aurangzaib
Messages: 43
Registered: April 2003
Member
salam

thx for ans... I know temporary table data is only visible for active sesion...but this problem , some one, give to me for exam .... so i ask the question... is there is any way that we could active the data for mutiple session (i meam the other session would be of report session as i can look from v$session) ... If as please help

thx
Re: Most Most Most urgent help need about temporary table and matrix reps [message #25938 is a reply to message #25937] Tue, 27 May 2003 18:32 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Only by copying the data from the temp table into a static table before exiting the first session.
Re: Most Most Most urgent help need about temporary table and matrix reps [message #25940 is a reply to message #25937] Tue, 27 May 2003 22:13 Go to previous message
Muhammad Aurangzaib
Messages: 43
Registered: April 2003
Member
salam

thx a alot for yu clrearance... i am thxfull to u of yu ans

thx
Previous Topic: How to convert dataTime format?
Next Topic: ROWS to COLUMNS
Goto Forum:
  


Current Time: Thu Mar 28 05:35:53 CDT 2024