Home » Developer & Programmer » Forms » Using Set_block_property Default Where only one time (Developer 6I Database 10g window XP)
Using Set_block_property Default Where only one time [message #411406] Fri, 03 July 2009 07:22 Go to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
Hellow All

I am using Set_block_property with Default_where but i need the where condition work only one time I use this query

SET_BLOCK_PROPERTY('block2', DEFAULT_WHERE, 'name= ''' || :block180.name2 || '''');
go_block('block2');
EXECUTE_QUERY;


Its work fine but he Block2 will Continue with Default_where

For example when i execute all record its execute only the record where name=:block180.name2

I need when i press button the trigger work and when i save my record or undo my record its will execute all record (not which name=:block180.name2


I hope you guys understand


Regards

Shahzaib ismail
Re: Using Set_block_property Default Where only one time [message #411407 is a reply to message #411406] Fri, 03 July 2009 07:24 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Use ONETIME_WHERE instead of DEFAULT_WHERE.
Re: Using Set_block_property Default Where only one time [message #411459 is a reply to message #411406] Sat, 04 July 2009 01:05 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
I used onetime_where but its not working i don't know whats wrong

Onetime_where is a Built in Procedure ?


Regards


Shahzaib ismail
Re: Using Set_block_property Default Where only one time [message #411481 is a reply to message #411406] Sat, 04 July 2009 04:31 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
@LittleFoot


As i Search the Topic Onetime_where and found one topic which Reference is
http://www.orafaq.com/forum/t/138881/0/


[
B]And David Wrote[/B]

Quote:
http://www.orafaq.com/forum/t/138881/0/



I need solution of onetime_where in Developer 6I


Regards


Shahzaib
Re: Using Set_block_property Default Where only one time [message #411482 is a reply to message #411406] Sat, 04 July 2009 04:32 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
David Wrote

Quote:
'Onetime_where' does not exist in Forms 6 but does exist in Forms 9i.

David



Re: Using Set_block_property Default Where only one time [message #411501 is a reply to message #411406] Sat, 04 July 2009 07:12 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
I done it with alternative way

I Create a button of Execute and write this trigger

SET_BLOCK_PROPERTY('block2', DEFAULT_WHERE, 'id>0');
go_block('block2');
EXECUTE_QUERY;


Regards


Shahzaib ismail
Re: Using Set_block_property Default Where only one time [message #412352 is a reply to message #411501] Wed, 08 July 2009 18:42 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You could also have used a control block item named, for example, 'first_time'. Then in the 'When-New-Form-Instance' trigger you would set it to 'Y'. Then, in the 'When-New-Block-Instance' you would test 'found_time' for 'Y' and if it is you set it to 'N' and in the 'else' part you will 'null' the 'default_where' of the block.

WNFI
begin
  first_time := 'Y';
end;

WNBI - BLK
begin
  if first_time = 'Y' then
    first_time := 'N';
    set_block_property('blk',default_where,' whatever ');
  else
    set_block_property('blk',default_where,'');
  end if;
end;

David

PS The code is only a guide, not actual working code.
Re: Using Set_block_property Default Where only one time [message #412364 is a reply to message #411406] Wed, 08 July 2009 23:24 Go to previous message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
Thanks for your idea David



Regard

shahzaib
Previous Topic: Oracle10g Migration
Next Topic: Centralizing forms.
Goto Forum:
  


Current Time: Fri Sep 20 10:22:36 CDT 2024