|
0 registered (),
3
Guests and
5
Spiders online. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
#936 - 16/03/05 05:29 PM
Janet & John do clever forms queries
|
Guru
 
Registered: 11/03/05
Posts: 1080
Loc: Bath
|
A real rave from the grave this one! Back in 1997 - but note the addendum...
A little reminder that it is possible to enter some quite clever queries via Oracle Forms. There are 3 distinct methods - 1. inequalities method 2. the '#' method 3. the 'substitution' or '&' method.
Note that this is not an Oracle Apps feature; rather it is a Forms feature
Inequalities method
Within a form, say People form: Enter a query. Within a chosen field enter either '>', '<', or '!=' followed by the actual value - meaning 'greater than', 'less than', or 'not equal to' the value. E.g:
In the date of birth field enter >31-DEC-1979 to return all records with a date of birth later than that date
'#' Method
Within a form say People form: Enter a Query and within your chosen field put '#' followed by a simple 'where' clause - although without the word 'WHERE'. E.g:
In the date of birth field enter
#IS NULL
When the query is executed, lo and behold all the records are returned with a null date of birth
Similarly entering
#BETWEEN '<date1>' AND '<date2>'
will return records where the date of birth falls between the 2 entered dates
You can also try using things like #IN ('x', 'y', 'z')
'&' Method
The restriction with the # method is the enter-able field size - if it's short you may not be able to fit the word 'BETWEEN' in there! A more versatile way is to use the '&' method. In query mode choose a field and enter the text '&x', or '&q' or '&dave' which ever suits you really! (what matters is the '&'). Then execute the query. A window entitled 'Query Where...' opens and you may then enter your full sql query before you hit <enter>. Again no 'WHERE' word is needed E.g the query text might read:
date_of_birth IS NULL and current_employee_flag = 'Y'
ADDENDUM
Nowadays this ability to perform '&' queries has by default been restricted. However, it can be turned back on. Get your friendly DBA to set the Unix parameter FORMS60_RESTRICT_ENTER_QUERY to FALSE then bounce the listener at a convenient point and you'll be back in business.
Edited by CT (19/08/10 01:19 PM) Edit Reason: Make original post more readable
_________________________
L&K CT
Remember: A dog is for life, not just for Christmas... unless you're in Korea
|
|
Top
|
|
|
|
#5681 - 19/08/10 01:01 PM
Re: Janet & John do clever forms queries
[Re: PeterP]
|
Guru
 
Registered: 11/03/05
Posts: 1080
Loc: Bath
|
Strangely enough, me neither! Although I have seen for myself today that the unix env variable FORMS60_RESTRICT_ENTER_QUERY still exists, albeit set to TRUE. The '#...' trick does indeed still work, subject to the restrictions of field query size. Also, it does not allow compound 'where' clauses, e.g. #LIKE '%AUG%' AND... the 'AND' bit triggers the same message as that encountered if you try the '&x' query. Edited to PS: Having just done a search for that parameter, it seems that the switching off was in response to a SQL injection vulnerability: http://www.red-database-security.com/wp/sql_injection_forms_us.pdf
_________________________
L&K CT
Remember: A dog is for life, not just for Christmas... unless you're in Korea
|
|
Top
|
|
|
|
#5683 - 19/08/10 01:22 PM
Re: Janet & John do clever forms queries
[Re: CT]
|
hacker
   
Registered: 08/03/07
Posts: 92
Loc: Manchester, UK
|
I have a VERY vague memory that there is a second env variable involved, but no clue as to what it was. However, even then, it didn't work. I did quite a few tests on this back in the dim distant past, as I used the "&" function all the time, especially to control ordering in forms where Oracle seems to have no sequence at all, and was quite disappointed that it's functionality had disappeared.
If anyone figures out how to get it working again, It would be great to learn how.
Cheers,
Peter.
P.S. I have just used #IS NULL in the Approved Salary field of the Salary Management form, and it didn't work. Although, I did use a #xxx query in another Folders based form and it did work.
Is this a form specific option?
Edited by PeterP (19/08/10 01:25 PM)
|
|
Top
|
|
|
|
|
756 Members
48 Forums
1517 Topics
7286 Posts
Max Online: 63 @ 24/11/10 07:21 AM
|
|
|
|
|
|
1
|
2
|
3
|
4
|
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
|
26
|
27
|
28
|
29
|
|
|
|
|
|