Home » Developer & Programmer » Forms » key_next_item trigger (oracle forms 10g)
key_next_item trigger [message #593924] Thu, 22 August 2013 01:12 Go to next message
furqan
Messages: 110
Registered: January 2012
Location: Hyderabad
Senior Member
hello sir,

i have KEY_NEXT_ITEM trigger on my text item.
its working fine fine but the only problem is,
if the value in the text item is numeric it working fine but
if its alpha numeric(alphabets + numbers) it needs single quotes
to be added to the value.want to avoid putting single quotes around
the values.please help.

code in trigger is..as follows.

if :text_item89 is not null and :text_item89='REMARKS' then
set_block_property('LOC_MSTR',default_where,'REMARKS='||:text_item88);
go_block('LOC_MSTR');
execute_query;
END IF;
Re: key_next_item trigger [message #593942 is a reply to message #593924] Thu, 22 August 2013 02:52 Go to previous messageGo to next message
cookiemonster
Messages: 10573
Registered: September 2008
Location: Rainy Manchester
Senior Member
Furgan - after 100 posts you should really know how to use [code] tags

You realise that you can refer to item names in block where clauses?
Re: key_next_item trigger [message #593945 is a reply to message #593924] Thu, 22 August 2013 03:54 Go to previous messageGo to next message
furqan
Messages: 110
Registered: January 2012
Location: Hyderabad
Senior Member
really sorry sir

if :rem is not null and :rem='REMARKS' then 
set_block_property('LOC_MSTR',default_where,'REMARKS='||:remarks1);
go_block('LOC_MSTR');	
execute_query;
END IF;




Re: key_next_item trigger [message #593946 is a reply to message #593945] Thu, 22 August 2013 03:56 Go to previous messageGo to next message
cookiemonster
Messages: 10573
Registered: September 2008
Location: Rainy Manchester
Senior Member
try:
set_block_property('LOC_MSTR',default_where,'REMARKS=:remarks1');
Re: key_next_item trigger [message #593971 is a reply to message #593946] Thu, 22 August 2013 05:35 Go to previous messageGo to next message
furqan
Messages: 110
Registered: January 2012
Location: Hyderabad
Senior Member
it worked..!!

thank you very much sir and i will be
careful next time while posting.
thanks again.
Re: key_next_item trigger [message #593992 is a reply to message #593971] Thu, 22 August 2013 07:12 Go to previous messageGo to next message
furqan
Messages: 110
Registered: January 2012
Location: Hyderabad
Senior Member
if :REM is not null and :REM='BILL_ID' then 
set_block_property('loc_mstr',default_where,'BILL_ID='||:ENTER1);
go_block('loc_mstr');
	EXECUTE_QUERY;
 

ELSIF :REM is not null and :REM='PLACE_FROM' then 		
set_block_property('loc_mstr',default_where,'PLACE_FROM=:ENTER1');		
go_block('loc_mstr');
	EXECUTE_QUERY;
		END IF;


this code is working when i am selecting bill_id
but not working when place_from is selected.
please guide.
Re: key_next_item trigger [message #593995 is a reply to message #593992] Thu, 22 August 2013 07:26 Go to previous messageGo to next message
cookiemonster
Messages: 10573
Registered: September 2008
Location: Rainy Manchester
Senior Member
Define not working - no data returned? error?
What datatype is enter1?
Re: key_next_item trigger [message #594002 is a reply to message #593992] Thu, 22 August 2013 08:02 Go to previous messageGo to next message
furqan
Messages: 110
Registered: January 2012
Location: Hyderabad
Senior Member
FRM-40350 query caused no records to be retrieved.
datatype entered in enter1 is char.
but records are there.
thanks

[Updated on: Thu, 22 August 2013 08:09]

Report message to a moderator

Re: key_next_item trigger [message #594003 is a reply to message #594002] Thu, 22 August 2013 08:04 Go to previous messageGo to next message
cookiemonster
Messages: 10573
Registered: September 2008
Location: Rainy Manchester
Senior Member
use get_block_property(<block>, last_query) to find out exact what query the form issued to the DB.
Or turn on DB tracing to get the same.
Re: key_next_item trigger [message #594007 is a reply to message #594003] Thu, 22 August 2013 08:26 Go to previous messageGo to next message
furqan
Messages: 110
Registered: January 2012
Location: Hyderabad
Senior Member
DECLARE
     lst_q VARCHAR2(2000);
     t VARCHAR2(2000);
BEGIN
    -- lst_q := GET_BLOCK_PROPERTY('ship_mstr', LAST_QUERY);
     --:ship_mstr.enter1:= lst_q;
     lst_q := :system.last_query;
:SHIP_MSTR.ENTER1:=lst_q;
END;

i write this on when button pressed.
but when i pressed the button it shows nothing.
Re: key_next_item trigger [message #594009 is a reply to message #594007] Thu, 22 August 2013 08:34 Go to previous messageGo to next message
cookiemonster
Messages: 10573
Registered: September 2008
Location: Rainy Manchester
Senior Member
Did you actually execute a query before running that?
is enter1 big enough to display the query?
Is enter1 modifiable?
Re: key_next_item trigger [message #594176 is a reply to message #593924] Sun, 25 August 2013 00:20 Go to previous message
furqan
Messages: 110
Registered: January 2012
Location: Hyderabad
Senior Member
i notice that if,before next search if
i do enter_query then its working fine.

thanks.
Previous Topic: Problem in saving, no errors shown and neither record is inserted
Next Topic: Storing a value in Copy BUFFER
Goto Forum:
  


Current Time: Fri Apr 18 22:34:18 CDT 2014

Total time taken to generate the page: 0.09248 seconds