Home » Developer & Programmer » Forms » Deleting Records from Form...
Deleting Records from Form... [message #82778] Thu, 03 July 2003 04:41 Go to next message
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 Go to previous messageGo to next message
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;
Re: Deleting Records from Form... [message #82791 is a reply to message #82787] Sat, 05 July 2003 00:32 Go to previous message
Muzzammil
Messages: 99
Registered: February 2003
Member
Tanks Mr. SCP.
Previous Topic: Bar Codes
Next Topic: Multiple Data Blocks
Goto Forum:
  


Current Time: Fri Apr 26 16:23:38 CDT 2024