Temporary table in report [message #624470] |
Tue, 23 September 2014 02:16 |
snsiddiqui
Messages: 172 Registered: December 2008
|
Senior Member |
|
|
May I use below code in my report AFTER PARAMETER FORM trigger? actually I want to create a temporary table, which will contain user given dates data then I will use this temporary table in my report.
Is my approach is correct? or if you know any other idea then please share.
Create or replace procedure GtempTbl_proc (Date1 Date, Date2 Date)
is
stmt varchar2(1000);
stmt2 varchar2(1000);
Begin
stmt := 'create global temporary table t1 as select * from ics_sal_sdr1@livedb_vikdis ';
execute immediate stmt;
stmt2 := 'create global temporary table t2 as select * from ics_sal_sdr2@livedb_vikdis ';
execute immediate stmt2;
End;
|
|
|
Re: Temporary table in report [message #624476 is a reply to message #624470] |
Tue, 23 September 2014 02:43 |
John Watson
Messages: 8960 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
This is almost certainly the wrong approach. You should be able to use the queries themselves in your report, no need to create tables. Furthermore, the code will run only once: the second time it will error because the tables already exist.
This looks like SQL Server code, where programmers create temporary tables all the time because SQL Server can't do read consistency properly.
|
|
|