Home » Developer & Programmer » Forms » Help with Oracle forms 6i (merged 3) (Forms 6i)
icon5.gif  Help with Oracle forms 6i (merged 3) [message #509845] Wed, 01 June 2011 05:49 Go to next message
ankur8819
Messages: 17
Registered: May 2011
Location: India
Junior Member
Hi I am new to Oracle forms and facing some issue with it.

I have a situation where on press of a button I need to delete some row in a table and perform my logic after this.
so I am using statement like

DELETE FROM distributor_authorization
WHERE control_num = :ctl_complaint.control_num;
COMMIT;
GO_BLOCK ('distributor_authorization');
CLEAR_BLOCK (no_validate);
HIDE_VIEW ('distributor_authorization');
HIDE_window ('window3');

The above code clear the data block and deletes the data from the table too but it opens up a window.
I guess this is because of the go_block statement I have used.The block has been placed on the canvas distributor_authorization which in turn is placed on window 3.
Although I have written code to hide the window but its not working for me.
Is there any other way I can achieve it.
I don't want the window to pop up when I clear the contents.

can I use something like
DELETE FROM distributor_authorization
WHERE control_num = :ctl_complaint.control_num;
COMMIT;
set_block_property('distributor_authorization', default_where, 'control_num = :ctl_complaint.control_num');
clear_block(no_validate);
execute_query;

Will this work without using go_block statement??
Re: Help with Oracle forms 6i (merged 3) [message #509850 is a reply to message #509845] Wed, 01 June 2011 05:55 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why are you not using delete_record?
Re: Help with Oracle forms 6i (merged 3) [message #509851 is a reply to message #509850] Wed, 01 June 2011 06:04 Go to previous messageGo to next message
ankur8819
Messages: 17
Registered: May 2011
Location: India
Junior Member
Even if i use delete_record I will have to clear the block right?
so it would be
go_block(....);
delete_record;
clear_block(no_validate);

This would mean the pop up would still come as I am using the go_block statement..
I need to hide this window.
Re: Help with Oracle forms 6i (merged 3) [message #509856 is a reply to message #509851] Wed, 01 June 2011 06:18 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why would you need to clear the block if you use delete record. That'll remove the deleted records from the block itself.
Re: Help with Oracle forms 6i (merged 3) [message #509860 is a reply to message #509856] Wed, 01 June 2011 06:30 Go to previous messageGo to next message
ankur8819
Messages: 17
Registered: May 2011
Location: India
Junior Member
and what about the window that is being displayed due to go_block('<BLOCK NAME>') statement?
Re: Help with Oracle forms 6i (merged 3) [message #509861 is a reply to message #509856] Wed, 01 June 2011 06:32 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
pop up would still come as I am using the go_block statement.

Which "pop up" is it? What does it say?
Re: Help with Oracle forms 6i (merged 3) [message #509865 is a reply to message #509861] Wed, 01 June 2011 06:51 Go to previous messageGo to next message
ankur8819
Messages: 17
Registered: May 2011
Location: India
Junior Member
Its actually a window .
Suppose I am using go_block(abc)

Datablock abc is placed on a canvas which is inturn placed on a window.
So this pop up is actually the window that comes.


and one more ques..
Do I need a Commit_form after delete_record ?
Re: Help with Oracle forms 6i (merged 3) [message #509870 is a reply to message #509865] Wed, 01 June 2011 07:04 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Let's clarify a few things shall we?

You've got a form with multiple blocks?
Those blocks are displayed in different canvas's in different windows?
The button is in one block - the records it needs to delete are in another?

As for commit_form - if you want the delete to be committed straight away then yes.
Otherwise you can wait for the user to press save.
Re: Help with Oracle forms 6i (merged 3) [message #509871 is a reply to message #509870] Wed, 01 June 2011 07:13 Go to previous messageGo to next message
ankur8819
Messages: 17
Registered: May 2011
Location: India
Junior Member
You've got a form with multiple blocks?--->Yes
Those blocks are displayed in different canvas's in different windows?--->Yes
The button is in one block - the records it needs to delete are in another?--->Yes

When the button is pressed it deletes the record in some other datablock(which is placed on a differnt canvas in different window.)
Though I am using the hide_view and hide_window statements ,but its now getting hidden.
After getting deleted the window remains there with null values.

HIDE_VIEW ('distributor_authorization');
HIDE_window ('window3');
Re: Help with Oracle forms 6i (merged 3) [message #509872 is a reply to message #509871] Wed, 01 June 2011 07:16 Go to previous messageGo to next message
ankur8819
Messages: 17
Registered: May 2011
Location: India
Junior Member
but its not getting hidden.*
Re: Help with Oracle forms 6i (merged 3) [message #509875 is a reply to message #509872] Wed, 01 June 2011 07:37 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
The window isn't getting hidden because the cursor is still in that window.
You'd need to go back to the other block before hiding the window.
Re: Help with Oracle forms 6i (merged 3) [message #509877 is a reply to message #509875] Wed, 01 June 2011 07:59 Go to previous messageGo to next message
ankur8819
Messages: 17
Registered: May 2011
Location: India
Junior Member
so if I use something like

go_item('<other_block>.<itemname>') ; (I navigate to some item in the other block)
hide_view();
hide_window();
it should also work right?



Re: Help with Oracle forms 6i (merged 3) [message #509888 is a reply to message #509877] Wed, 01 June 2011 08:39 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Yes, though you shouldn't need hide_view and you might have the window being temporarily visible.
Might I suugest you navigate back to the button. That's where the cursor was at the start of this operation.
Previous Topic: Can not exit_form properly
Next Topic: record status bar
Goto Forum:
  


Current Time: Thu Sep 12 08:58:21 CDT 2024