Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Block level commit.

Status
Not open for further replies.

tyb

Technical User
Feb 10, 2004
137
IR
Dear frends is there any block level commit function as i want to save the changes only in my current block regardless of others. (clear_block can solve the problem but in this case i'v to requery the block to display changes.)

thanks & regards.
 
Hi,
You may manipulate On-Insert/On-Update/On-Delete triggers to achieve the Desired Result.

Regards
Himanshu
 
thanks Himan for ur response

still i'm unable to get at how can it be done , preventing the changes in other blocks form being saved.

thanks
 
Hi,
Assume that you have Form made of Two blocks A & B.
Make two Package Varibales X & Z.Keep the Default value of noth of these as N.
If you chnage any feild in Block A set the vlaue of Varibale X to Y.
Now if user chnages any feild in block B also then check if Value of X is already Y then let the value of Z remain N else chnage it to Y.

Add On-Insert trigger on each Block.
In block A's Trigger check
if X ='Y' then
INSERT_RECORD;
else
NULL;
End If;

Similarily add code in Block B's trigger.
Note that value of Z is N so the code will go in Else part which is NULL , hence no data will be inserted.

Create Similar triggers On-Update/On-Delete for Update/Delete statements.

Regards
Himanshu
 
Dima,
I think this is what is required by TYB.

Mne Ni poniyatna pochemy ti eto pisal potomushto ya pitalsya tolko otvetit na vaproc.
Esli y tibiya est lutshii variant, dai nam toje znat.

Poka,
Himanshu
 
Himanshu, I thought that the idea was to commit single block without affecting others and defer posting changes in other blocks. In this case instead of "NULL;" it would be better to store changed record numbers and then restore record statuses to be processed by "ordinary" commit.
But in such situations I usually recommend placing blocks on different forms.

BTW I understand English.

Regards, Dima
 
Thanks Dima.
I know that you understand English but I wrote the Message in Russian as this was more of a Personal type of remark.

BTW you have a very good looking Son.

Cheers,
Himanshu
 
Thanks u both Himan and Sem

and yes Himanshu dear sem is right i wanted to execute commit
on one block only leaving the changes in other blocks intact.

many thanks
 
I like to make the block a non-database block. Perform data verification, then issue an update statement using the fields.

UPDATE EMPS
set last_name = :emps.last_name
where empnum = :emps.empnum;

 
Brasl, issuing DML commands from PL/SQL is not recomended, because in this case Forms information about the state of transaction becomes outdated.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top