Home » SQL & PL/SQL » SQL & PL/SQL » commit based on Group name (Win XP, Oracle 10g)
commit based on Group name [message #335134] Mon, 21 July 2008 02:58 Go to next message
freakabhi
Messages: 74
Registered: November 2007
Location: mumbai
Member
Hi All,

I got a requirement to insert data with commit interval,
but commit interval is not time based it is based on group values.. i.e see below code


insert into xyz(d_create_dt,cl_cnt,chn_cd ......)
select sysdate,count(*),chn_cd,.....
from chn_data
group by chn_cd,....



requirement says, I have to commit when records pertaining to particular chn_cd are inserted.

now, I am having no clue how to do this..
can anybody help..?


from,
freakAbhi

[Updated on: Mon, 21 July 2008 03:00]

Report message to a moderator

Re: commit based on Group name [message #335135 is a reply to message #335134] Mon, 21 July 2008 03:10 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I got a requirement to insert data with commit interval,

This is not a good idea.

Quote:
I have to commit when records pertaining to particular chn_cd are inserted.

Find each chn_cd and insert all records concerning each one with one insert for each.

Regarrds
Michel
Re: commit based on Group name [message #335152 is a reply to message #335134] Mon, 21 July 2008 04:32 Go to previous messageGo to next message
jyothsna1612
Messages: 68
Registered: June 2008
Member
Hi
I didn't understand
'inserting data with commit interval'

Please excuse me if it's a simple question

Thanks
Re: commit based on Group name [message #335156 is a reply to message #335152] Mon, 21 July 2008 04:39 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
What exactly don't you understand?

Do you know what an insert is?
Do you know what data is?
Do you know what a commit is?
Do you know what an interval is?

So if you combine all that you get some procedure that inserts data with a commit at specific intervals.

(Which is a bad idea in about 95% of cases by the way)
Re: commit based on Group name [message #335303 is a reply to message #335134] Mon, 21 July 2008 15:16 Go to previous message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
If this is a homework assignment tell your instructor that this is a trick question. You want to commit when you are done. It is the proper way to do it and avoids the good old snapshot too old error.
Previous Topic: Auditing DML actions on multiple databases
Next Topic: need help in my code
Goto Forum:
  


Current Time: Mon Dec 05 13:10:39 CST 2016

Total time taken to generate the page: 0.10541 seconds