Re: avoid duplicate sql

2001-08-08 Thread nlzanen1
Hi, How 'bout insert into your_users select user_name, logon_time from v$session a where not exist (select user_name, logon_time from your_users b where a.user_name = b.user_name and a.logon_time = b.logon_time)

Re: avoid duplicate sql

2001-08-08 Thread james ellis
Can you change from a sql statement to an anonymous pl/sql block? You can trap for dup val on index or check for the records existence prior to trying to insert the new record. james --- Tatireddy, Shrinivas (MED, Keane) [EMAIL PROTECTED] wrote: Hi lists i need help in writing a sql query:

Re: avoid duplicate sql

2001-08-08 Thread Jon Walthour
Srinivas: How about this: select sid , serial# from sys.v_$session where (sysdate-logon_time) = (30/(24*60)); This will give you a list of all the sessions that have been connected for 30 minutes or less. HTH Jon Walthour From: Tatireddy, Shrinivas (MED, Keane) [EMAIL PROTECTED]

RE: avoid duplicate sql

2001-08-08 Thread Page, Bruce
No script, but an idea. Insert into a transaction table first. Then insert from your transaction table only the records that do not already exist in your data table. -Original Message- From: Tatireddy, Shrinivas (MED, Keane) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 08,

Re: avoid duplicate sql

2001-08-08 Thread OZKAN OZCAN
Try this, it selects the one who connect in half an hour ... but you can use a dynamic sql instead if this works via cron and write the where clause by taking from system date and time.. select sysdate, sysdate - 1./48. , s.logon_time from v$session s where logon_time sysdate - 1./48.