anumoses
asked on
oracle forms question
I have a code in a free txt field called comments
and the code is
If :open_reason is null then
msgbox.show('Reason', 'Reason to Re-Open cannot be Null. Please verify re-enter.', 'OK');
go_item('open_reason');
raise form_trigger_failure;
Else
go_item('emp_validation.em p_id');
hide_window('open_reason') ;
End if;
------------The user is just tabbing or entering a space and are able to exit. How can I prevent?
and the code is
If :open_reason is null then
msgbox.show('Reason', 'Reason to Re-Open cannot be Null. Please verify re-enter.', 'OK');
go_item('open_reason');
raise form_trigger_failure;
Else
go_item('emp_validation.em
hide_window('open_reason')
End if;
------------The user is just tabbing or entering a space and are able to exit. How can I prevent?
ASKER
It did not work. I did a return carriage {enter} key and was able to exit
What trigger are you putting this code in?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
What trigger are you putting this code in?
When-button-pressed trigger
For example can someone exit with a single | character?
yes. They are able to exit
When-button-pressed trigger
For example can someone exit with a single | character?
yes. They are able to exit
ASKER
I tried this
select dump(open_reason), open_reason from qc_daily_confirmations
where trunc(CREATE_TIME) = trunc(sysdate)
DUMP(OPEN_REASON)|OPEN_REA SON
Typ=1 Len=1: 10|
Its a return carriage I used to exit out
select dump(open_reason), open_reason from qc_daily_confirmations
where trunc(CREATE_TIME) = trunc(sysdate)
DUMP(OPEN_REASON)|OPEN_REA
Typ=1 Len=1: 10|
Its a return carriage I used to exit out
ASKER
I also tried in my code using
replace(replace(:open_reas on,chr(10) ,' '),chr(13),' ');
did not help
replace(replace(:open_reas
did not help
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I got a function from oracle forums. Its works for me
CREATE OR REPLACE FUNCTION strip_bad (p_string IN VARCHAR2)
RETURN VARCHAR2
IS
good_string VARCHAR2(62)
:= 'ABCDEFGHIJKLMNOPQRSTUVWXY Z' ||
'abcdefghijklmnopqrstuvwxy z' ||
'1234567890';
BEGIN
RETURN
TRANSLATE (p_string, 'T' ||
TRANSLATE ( p_string, '.' || good_string
, '.'
) -- find the bad characters
, 'T'); -- remove the bad characters
END;
--------------------
select strip_bad('0110.-()*"'||ch r(10)||'~! @#$%^&*()| ') as strip_bad from dual;
STRIP_BAD
0110
CREATE OR REPLACE FUNCTION strip_bad (p_string IN VARCHAR2)
RETURN VARCHAR2
IS
good_string VARCHAR2(62)
:= 'ABCDEFGHIJKLMNOPQRSTUVWXY
'abcdefghijklmnopqrstuvwxy
'1234567890';
BEGIN
RETURN
TRANSLATE (p_string, 'T' ||
TRANSLATE ( p_string, '.' || good_string
, '.'
) -- find the bad characters
, 'T'); -- remove the bad characters
END;
--------------------
select strip_bad('0110.-()*"'||ch
STRIP_BAD
0110
ASKER
thanks
If trim(:open_reason) is null then
...