Home » Developer & Programmer » Forms » How to delete the record ? (form 10g)
How to delete the record ? [message #333307] Fri, 11 July 2008 03:41 Go to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Hi
The datablock have their own insert and query using thru commit_form.

The same, can delete using thru commit_form without explicitly using delete statement. But I fix the record which want to delete.

kanish





Re: How to delete the record ? [message #333320 is a reply to message #333307] Fri, 11 July 2008 04:19 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm sorry, but I don't understand what you are talking about. Could you try once again, please?
Re: How to delete the record ? [message #333328 is a reply to message #333307] Fri, 11 July 2008 04:45 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

I have datablock of statemaster which having multirecords.

In which add,query,delete,save,clear,exit button.

1. Add
Im inserting one or more records and saving.
2. Query
I can query record and save.
3. Delete
I want to pick the statecode from lov
and that record i want
delete

4. Save (commit_form)
each action want to commit using this save button

Help me for the bold request.

kanish


Re: How to delete the record ? [message #333335 is a reply to message #333328] Fri, 11 July 2008 05:10 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is how I would do that:
- enter query mode
- select "statecode" from list of values
- execute query
- delete a record which is displayed as a result of query operation
- commit
Re: How to delete the record ? [message #333670 is a reply to message #333307] Mon, 14 July 2008 01:59 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Hi Littlefoot,
As you said i feel i done. check Weather it is correct or not
to achieve my work.

On Delete Button(when_button_pressed)

:Global.Mode := 'DELETE';
go_item('Statecode');


On Statemaster Block(when_new_block_instance)

If :Global.Mode = 'QUERY' Then
	  Execute_query;
End If;

If :Global.Delete = 'DELETE' Then
	  Enter_Query;	  
End If;


On Statecode Item (Key_next_item)

If :Global.Mode = 'DELETE' Then
	 Set_block_property('statemaster', default_where, 'statecode = ' || :Statecode);
	 Execute_Query;
End If;



Kanish
Re: How to delete the record ? [message #333675 is a reply to message #333670] Mon, 14 July 2008 02:18 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
check Weather it is correct or not

What happened when you tested it?
Re: How to delete the record ? [message #333679 is a reply to message #333307] Mon, 14 July 2008 02:47 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

It fetches all the records from the table instead of selected one.

kanish
Re: How to delete the record ? [message #333683 is a reply to message #333679] Mon, 14 July 2008 03:02 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
It fetches all the records from the table instead of selected one.

I'd rather say "all records from a table whose STATECODE column equals :STATECODE form item's value".

If there are too many records and you need only one of them, you'll have to further restrict fetched data set by including additional condition into the DEFAULT_WHERE clause.
Re: How to delete the record ? [message #333690 is a reply to message #333307] Mon, 14 July 2008 03:11 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Ok its working.

because problem in block name spelling mistake. It fetching exact row what i need.

Now i want to press(ctrl+up arrow) to delete the row

and then save(commit_form) that is the procedure. correct

kanish

Re: How to delete the record ? [message #333696 is a reply to message #333690] Mon, 14 July 2008 03:24 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
i want to press(ctrl+up arrow) to delete the row
If that's mapped to "delete record", yes.

Quote:
then save(commit_form)
Yes, in order to save the changes.
Previous Topic: how change the where clause in block?
Next Topic: EXECUTE IMMEDIATE( )
Goto Forum:
  


Current Time: Sat Dec 10 02:56:26 CST 2016

Total time taken to generate the page: 0.11931 seconds