Solved

oracle forms question

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle regular expression 6 47
oracle 11g 23 51
Oracle 12c database link between pdb not working 20 48
Component is listed with a Protocol more than once 3 5
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…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

863 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

23 Experts available now in Live!

Get 1:1 Help Now