Deleting Records from Form... [message #82778] |
Thu, 03 July 2003 04:41 |
Muzzammil
Messages: 99 Registered: February 2003
|
Member |
|
|
Hi,
I have written a CURSOR to find the entered branch in perticular date is available or not its working fine through which
if found I am delete the old records and inserting new records
else
insert new records
Example:
CURSOR
SELECT...
BEGIN
OPEN...
IF idate=:vdate and ibranch=:vbranch then
delete from sales where idate=:vdate and ibranch=:vbranch
INSERT INTO SALES
SELECT * FROM ITEMMAST
commit;
else
INSERT INTO SALES
SELECT * FROM ITEMMAST
commit;
END IF;
The above Cursor is taking very very long time to process and display in the form.
Please tell me how to increase performance.
Thanks,
Syed Muzzammil.
|
|
|
Re: Deleting Records from Form... [message #82787 is a reply to message #82778] |
Fri, 04 July 2003 04:59 |
SCP
Messages: 21 Registered: June 2003
|
Junior Member |
|
|
Instead of INSERT INTO SALES SELECT * .... Try
INSERT INTO SALES SELECT COL1,COL2.....
Commit can appear once after the end if statement.
Your code can be like this also
IF idate=:vdate and ibranch=:vbranch then
delete from sales where idate=:vdate and ibranch=:vbranch
END IF;
INSERT INTO SALES
SELECT col1,col2 FROM ITEMMAST
commit;
|
|
|
|