Solved

oracle forms question

Posted on 2011-09-29
10
303 Views
Last Modified: 2012-05-12
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.emp_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?
0
Comment
Question by:anumoses
  • 6
  • 2
  • 2
10 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36817840
Try this:

If trim(:open_reason) is null then
...
0
 
LVL 6

Author Comment

by:anumoses
ID: 36817869
It did not work. I did a return carriage {enter} key and was able to exit
0
 
LVL 7

Expert Comment

by:Jacobfw
ID: 36817884
What trigger are you putting this code in?
0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 125 total points
ID: 36817886
With 9i your options are pretty limited.

What are your 'allowable' characters?

For example can someone exit with a single | character?
0
 
LVL 6

Author Comment

by:anumoses
ID: 36890960
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
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Author Comment

by:anumoses
ID: 36891030
I tried this

select dump(open_reason), open_reason from qc_daily_confirmations
where trunc(CREATE_TIME) = trunc(sysdate)

DUMP(OPEN_REASON)|OPEN_REASON
Typ=1 Len=1: 10|

Its a return carriage I used to exit out
0
 
LVL 6

Author Comment

by:anumoses
ID: 36891035
I also tried in my code using

replace(replace(:open_reason,chr(10),' '),chr(13),' ');

did not help
0
 
LVL 7

Assisted Solution

by:Jacobfw
Jacobfw earned 125 total points
ID: 36891051
when-button-pressed?

if you are attempting to validate a free form field with entry, you should be using the When-validate-item
0
 
LVL 6

Author Comment

by:anumoses
ID: 36891219
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)
          := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ||
             'abcdefghijklmnopqrstuvwxyz' ||
             '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.-()*"'||chr(10)||'~!@#$%^&*()|') as strip_bad from dual;

STRIP_BAD
0110
0
 
LVL 6

Author Closing Comment

by:anumoses
ID: 36891354
thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to recover a database from a user managed backup

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now