Re: obtaining the username for form display

From: Adrian G. Klingel <klingela_at_nospam.nt.com>
Date: 1998/02/23
Message-ID: <34F21086.D63782B_at_nospam.nt.com>#1/1


Your code works for me. But only when I specify a length for the varchar2 field, like VARCHAR2(30). Make sure you've got the block and item names right. You also might try:

  declare

       uname varchar2(30);

   begin

        select user into uname
        from dual;

       :my_blk.name := uname;

   end;

   I tried this too, and it works also. I put these in a WHEN-NEW-FORMS-INSTANCE trigger in Forms 5.0. Hope this helps!

Adrian Klingel
consultant

blak wrote:

> I'm having problems obtaining the username so that I can display it in
> a text field on my form.
> I have tried using GET_APPLICATION_PROPERTY(USERNAME), but it gives me
> the error :
> FRM-40735: WHEN-CREATE-RECORD trigger raised unhandled exception
> VALUE_ERROR
>
> The code I have used is:
> DECLARE
> the_username VARCHAR2;
> BEGIN
> the_username := Get_Application_Property(USERNAME);
> :my_blk.name := the_username;
> END;
>
> but it doesn't even get as far as assigning the_username to the block
> item.
> Can anyone help? Thanks
Received on Mon Feb 23 1998 - 00:00:00 CET

Original text of this message