Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

prevent interpretation of special characters in enter-query mode

ba-1983Feb 17 2009 — edited Feb 17 2009
My problem goes as follows:

- forms version: Forms [32 Bit] Version 6.0.8.10.3 (Production)

- non-database item block.X, char
- block.X is filled in post-query trigger. The post-query logic cannot be integrated in a view because it uses procedures, and usage of a pipelined function + view is currently not allowed due to "internal restrictions". Put simply: all logic to fill the field must remain in the post-query trigger
- user wants the field to be queryable. This is achieved by storing the entered criterium in a variable in the pre-query trigger, and using it in the post-query trigger to exclude records. E.g.

pre-query ==> help_block.query_X := block.X;
post-query ==> if help_block.query_X is not null and block.X is null or not block.X like help_block.query then raise form_trigger_failure; end if;

- this works fine for "regular" search strings. However:
- whenever the search string starts with <, <=, >, >=, !, forms seems to interpret the leading characters before doing anything else. During pre-query, block.X is null, and as soon as I use it in pl/sql, I get FRM-40831: Truncation Occured: value too long for field. E.g.

user puts the following in block.X ==> '<X', so he wants to search for records with value '<X' (text; not 'smaller than ...')
pre-query => msg.show(block.X) ==> appears to be empty/null, but right after the message, I get FRM-40831 Truncation Occured: value too long for field ...

This only happens if < is the first non-space character in the search string.

Does anyone know of a way to prevent oracle from interpreting the <, <=, ... characters entered in enter-query mode?

Comments

680937
Hi,

Does anyone know of a way to prevent oracle from interpreting the <, <=, ... characters entered in enter-query mode?

What do you mean by this?.....

If you want to show the proper error message then catch this error in on-error trigger and on occuring of this error you can display a proper message.....

Thanks,
Pavan
ba-1983
I'm sorry for not making myself clear; I'll give it another go:

The problem is that, if I enter '<abc' in a form field in enter-query mode (so during creation of the "example record"), forms immediately interprets the < as 'smaller than' and does some obscure things with it (my guess: converting to a where clause, but since I'm using a non db field, this actually does nothing), and finishes by erasing the field contents (in the example record). In the pre-query trigger, I can no longer get the '<abc' and store it. I want one of the following:

- prevent forms from interpreting the '<' in front (same thing happens for !=, <=, >=, =, ...)
or
- capture the entered string ('<abc') before forms reacts to the '<' in front

Edited by: brecht.adriaens@radaraut.com on Feb 17, 2009 12:30 PM
680937
Hi,

If you want to store the value that entered in the field ,then you can follow this one,
once you allow the customer to enter the string and before forms starts performing on that (means user enters a string press button to get the value for the string that he entered) you store that value in one of the global variable(If you know how to handle global variable) or just assign that value to any ohter field.

Thanks,
Pavan.
ba-1983
<snip>

... I misunderstood your reply. Do you mean duplicating the input in another field while the user is still typing? (if so: is there an easy way to do this?). As soon as the user presses 'execute query', the variable is converted and the example record field is erased, so I can't store it anymore (I tried just about all possible triggers... no luck).

Just to be clear: I have the same problem in the key-exeqry trigger... the field is already empty.
680937
Hi,

Before user presses the execute query store the value into the other field.

Thanks,
Pavan

Edited by: Pavan Patil on Feb 17, 2009 5:25 AM
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 17 2009
Added on Feb 17 2009
5 comments
680 views