Solved

oracle forms question

Posted on 2011-09-29
10
305 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
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 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
 
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
automatic email alert 1 50
Query Records that don't match 8 42
Oracle sql query 7 60
Use of Exception to end a Loop 3 31
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to recover a database from a user managed backup

770 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