Home » Developer & Programmer » Forms » Save seleted record
Save seleted record [message #254796] Sat, 28 July 2007 06:25 Go to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
hi
see attached file I want to save selected reocrd in my table i write these line in when button pressed commit button

begin
	go_block ('blockname');
	if :kcheck <> 'Y' then
	do_key ('delete_reord');
	else
	commit;
end if;
end;


but save all the records.

I have master and detail block and this pictire is detial block.

[Updated on: Sat, 28 July 2007 06:40]

Report message to a moderator

Re: Save seleted record [message #254802 is a reply to message #254796] Sat, 28 July 2007 07:28 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
COMMIT saves all records in the whole form (i.e. all records in all blocks).

If you want to remove records with empty checkboxes, you'll have to loop through all of them, remove one by one and commit at the end, out of the loop.
Re: Save seleted record [message #254965 is a reply to message #254796] Mon, 30 July 2007 03:22 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Check what value is being return by the check box when it is unchecked. I belive that it is returning NULL if so then either use NVL or assign unchecked value 'N'
Re: Save seleted record [message #255623 is a reply to message #254965] Wed, 01 August 2007 05:56 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
I used N in unchecked value and following code is using

begin
	go_block ('sub_fabric_delivered');
	first_record;
	loop
	if :kcheck <> 'Y' then
	--do_key ('delete_reord');
	Clear_record;
	end if;
	exit when :system.last_record = 'Ture';
	next_record;
	end loop
		commit;
end;


Showing same error
FRM;40102
Re: Save seleted record [message #255626 is a reply to message #255623] Wed, 01 August 2007 05:59 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Plz correct your statement with the following:

exit when :system.last_record = 'TRUE';
Re: Save seleted record [message #255632 is a reply to message #255626] Wed, 01 August 2007 06:13 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
What should be????
Re: Save seleted record [message #255809 is a reply to message #255632] Wed, 01 August 2007 16:10 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Should be true, not ture.
Previous Topic: Cliemt Machine Name in forms 6i
Next Topic: query
Goto Forum:
  


Current Time: Sat Dec 07 06:28:04 CST 2024