BIG BUG
A reader, November 08, 2002 - 11:23 am UTC
Hi, TOm,
Until today, I found a very BIG BUG in the oracle form.
THat is when you run the form, the default logon window
OR log_on ptocedure can not catch the blank padded after
the username:
Username: "abcd "
Password: ....
connect string: "...."
The form let this logon info passed even there are lots
of spaces after the "abcd". This caused us lots of trouble
because we use the "GET_APPLICATION_PROPERTY(USERNAME)"
lots of times and store them in the DB---- with the blanks
padded after the real username. I mean we should not let the
logon username with the blanks padded passed, how can we do that?
Thanks
November 08, 2002 - 12:44 pm UTC
it is not a bug in forms -- it is a bug in your code.
You should have used rtrim( get_application_property(username) ) to trim it if that is what you need.
Connect to DB
A reader, November 08, 2002 - 12:59 pm UTC
Hi, TOm,
I can not agree with you.
Say, id you connect to DB by "abcd " instead of
"abcd", then you can not log into the DB.
How will you explain the difference?
Thanks and have a nie day
November 08, 2002 - 1:03 pm UTC
you don't have to agree with me -- however, unless and until you use rtrim -- you are hosed right?
ops$tkyte@ORA920.US.ORACLE.COM> connect scott /tiger
Connected.
ops$tkyte@ORA920.US.ORACLE.COM>
hmm? you could always use USER as well -- instead of get app property.
Learn another thing from you
A reader, November 08, 2002 - 1:32 pm UTC
HI, TOm,
How did you get:
ops$tkyte@ORA920.US.ORACLE.COM> connect scott /tiger
Connected.
ops$tkyte@ORA920.US.ORACLE.COM>
mine is got error:
connect scott /tiger
Invalid option.
Usage: CONNECT <username> [AS SYSDBA|SYSOPER]
is it 9i diffenrent from 8i?
Ok, would you tell me the fact behind the scene that why
we allow blank padded username passed validation--why
get_application_property(username) doesn't auto trim the right space? Is it because we can create an user in DB with several blanks
padded? If so, why can't I log into DB either with
connect scott /tiger OR
connect "scott "/tiger?
My exsting system has lots of GET_APPLICATION_PROPERTY(USERNAME) both in forms and packages in DB, I don't want to
mofified them one by one? Are you tell me that GET_APPLICATION_PROPERTY(USERNAME) is not safe and we should always use USER? I mean that
the HELP system in the file should address that issue at least to the developer?
Thanks and have a nice day
November 08, 2002 - 2:13 pm UTC
JServer Release 8.1.7.4.0 - Production
ops$tkyte@ORA817DEV.US.ORACLE.COM> connect scott /tiger
Connected.
ops$tkyte@ORA817DEV.US.ORACLE.COM>
PL/SQL Release 8.0.6.0.0 - Production
ops$tkyte@ORA806.WORLD> connect scott /tiger
Invalid option.
Usage: CONNECT <username> [AS SYSDBA|SYSOPER]
looks like 8i and up is OK with this.
You can use get app property -- you just have to be aware that it returns what the user typed. If trailing blanks are a problem -- you could add a trigger to the table:
...
:new.userid_field := rtrim(:new.userid_field);
.....
and that'll fix all of the forms.
Login Screen in the beginning
Raj, April 29, 2003 - 1:23 am UTC
Hi Tom,
I tried the sol. given above(Clicking the button and displaying the logon screen) but I have a similar problem.
Actually I want the default logon_screen to appear all the time whenever I access the application in the beginning itself.
I tried giving logon_screen built-in in preform I get only the logon screen but when I click connect it goes to the application without giving any error message even if I give the wrong password.
My requirement is
When I click the application the default screen should appear and I should connect to the database based on the informations I enter in the default logon screen or display an error if the data given is not correct.
If I click cancel it shoul exit the form
Pls. give me a solution.
April 29, 2003 - 8:03 am UTC
i don't code forms, haven't done so since about 1995 when this web thing came along. I can suggest you try otn.oracle.com under discussion forums -> developer. there you will find many people who use forms every day. they may be able to help.
A reader, July 21, 2004 - 5:35 pm UTC
Suppressing the default form logon is not a good idea when you connect to Oracle Data Source.
This is specially given for Non-oracle data sources.
Like You can connect to a non-oracle data source in on-logon trigger.