Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

oracle forms question

Posted on 2011-09-29
10
Medium Priority
?
312 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 78

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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to recover a database from a user managed backup
Suggested Courses
Course of the Month20 days, 18 hours left to enroll

810 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