Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Question -> how to insert values into a table bases on seconds
option 1- don't commit. If you insert into tres_1_0197 in session 1 and don't commit it -- session 2 cannot "see" it (and yes, session 2 can insert into it without blocking). At the end of the report, issue a rollback and you won't even have to delete the data.
option 2- add a column to the table called 'sess_id', to the temp table. Default this column to userenv('sessionid'). create a view on top of the table that selects all columns but the sess_id column and add a where clause "where sess_id = userenv('sessionid'). for example
create table tmp_table ( x int, y int default userenv('sessionid') ); create view tmp_view as select x from tmp_table where y = userenv('sessionid');
Then, use tmp_view as you would have used tres_1_0197. I will only see 'my' rows. You need to delete from it yourself.
On Wed, 14 Jan 1998 10:41:26 -0500, "Zembla" <zembla_at_cam.org> wrote:
>Here is my problem.... I need to insert information in a temp table.
>
>My table is called tres_l_0197
>
>Two users at the same time (first one at 9 Oclock and second one at 9h05 )
>will execute a report that is called res_l_0197 and the report will store
>info in the table tres_l_0197.
>
>Both report will insert into tres_l_0197 the SAME information
>
>Ex: Anna Kennedy and all her info will be store TWICE in tres_l_0197.
>
>And the two report HAVE to print all the information on their printer.
>My problem is that the report will print the information no problem but in
>DOUBLE. Anna Kennedy will be print two time instead of only one because her
>name is stored twice in the table..
>
>My question is HOW can I store the information in table tres_l_0197 wtih two
>people executing the same report at the same time WITHOUT printing the
>information in double.
>
>THANKS ALL IN ADVANCED AND PLEASE I NEED THIS QUICK..
>
>ARGGGG
>
>Ghis
>Zembla_at_cam.org
>
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Jan 14 1998 - 00:00:00 CST
![]() |
![]() |