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!

Global Variable Username

538424Apr 8 2008 — edited Apr 9 2008
I am looking for a way to create a dynamic record group query in which the where clause is based on the global username (whoever is logged into the database where the form is running on).

The record group query is something like this:
select sch.school, sch.long_name from schools sch, user_schools us where us.school = sch.school
and us.user_name = :GLOBAL.user_name;

I have searched this forum and can not find what a pre-defined built-in would be to capture the user running the form.

I do know that if I wanted to create a global variable I would have to set it like this:
:GLOBAL.user_name := get_application_property(USERNAME);

I have put the :GLOBAL.user_name variable setting in the BEGIN block of a WHEN-NEW-FORM-INSTANCE trigger on my form. However, when I paste the above SQL query into my record group I get a "FRM-12001: Cannot create the record group (ckeck your query)." error message.

Any help with this or a push in the right direction to another post I have missed would be greatly appreciated.

Thanks in advance,

Kyle
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2008
Added on Apr 8 2008
9 comments
1,847 views