LOGON function [message #678283] |
Sat, 23 November 2019 03:12 |
|
Shiv93
Messages: 34 Registered: September 2019
|
Member |
|
|
Hi,
I have a requirement of to connect to a Database from forms but not sure how to implement it from the oracle forms.
Can anyone let me know hoe to implement the logic?
|
|
|
|
|
|
Re: LOGON function [message #678325 is a reply to message #678306] |
Sun, 24 November 2019 15:30 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
OK, LOGON built-in exists, you can use it, but ... what benefit do you expect from it? I mean, what difference will it make if you login as you do it now (<Ctrl + J> and fill username, password and database) or using the LOGON?
Did you follow the example Oracle provides in Forms Online Help system?
Did you read the documentation? If you did, why did you set the last (optional) parameter to FALSE? TRUE is default and might actually help:
Forms Help, LOGON built-in, logon_screen_on_error parameter
An optional BOOLEAN parameter that, when set to TRUE (default), causes Forms Developer to automatically display the logon screen if the logon specified fails (usually because of a incorrect username/password). When logon_screen_on_error is set to FALSE and the logon fails, the logon screen will not display and FORM_FAILURE is set to TRUE so the designer can handle the condition in an appropriate manner.
|
|
|
Re: LOGON function [message #678329 is a reply to message #678325] |
Mon, 25 November 2019 02:32 |
|
Shiv93
Messages: 34 Registered: September 2019
|
Member |
|
|
Hi LittleFoot/BlackSwan ,
Thanks for your time in replying.
SO i have designed a login page with two inputs and a login button.
1. username
2. pwd
on click of the login button i execute the following code.
Begin
LOGON (Username, pwd || '@' || 'DB', FALSE);
IF FORM_SUCCESS THEN
call_form('new_form',HIDE,DO_REPLACE);
ELSE
MESSAGE('Unable to Connect to the form');
END IF;
END;
So now my question is on what basis the LOGON inbuilt function validates the user . Does it looks for the schema name in the DB to validate the user,because if i login with the schema name i was able to login to the form successfully.
[Updated on: Mon, 25 November 2019 02:44] Report message to a moderator
|
|
|
|
Re: LOGON function [message #678336 is a reply to message #678306] |
Mon, 25 November 2019 04:15 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
[quote title=BlackSwan wrote on Sun, 24 November 2019 00:17]Sivachandran wrote on Sat, 23 November 2019 04:41
There are two problems with post above.
1) We don't know what actual code is contained in LOGON function above.
If you're going to comment on forms issues it's help if you knew something about forms.
Logon is a forms built-in function. The only people who get to see the actual code it contains are actual oracle employees.
|
|
|
|
Re: LOGON function [message #678439 is a reply to message #678335] |
Wed, 04 December 2019 03:58 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
cookiemonster wrote on Mon, 25 November 2019 10:07In oracle schema=user.
You seem to think otherwise.
So what is user to you?
If your SQL statements are running against tables belonging to other schemas it'll be because
a) the code specifies the schema in the SQL
b) there are synonyms that point to the tables in the other schema
c) the following has been run:
alter session set current_schema = <schema name>
|
|
|
|
Re: LOGON function [message #679812 is a reply to message #679811] |
Tue, 31 March 2020 03:39 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Here's a walkthrough which shows what you have, what you should (and should not) do to make it work.
Connected as SCOTT, I can't select from v$session:
SQL> show user
USER is "SCOTT"
SQL> select count(*) from v$session;
select count(*) from v$session
*
ERROR at line 1:
ORA-00942: table or view does not exist
Connect as a privileged user (it is SYS in my test XE database; use your own user you use for such purposes) and grant SELECT. Note the difference!
SQL> connect sys as sysdba
Enter password:
Connected.
SQL> grant select on v$session to scott;
grant select on v$session to scott
*
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
SQL> grant select on v_$session to scott;
Grant succeeded.
Back to SCOTT:
SQL> connect scott
Enter password:
Connected.
SQL> select count(*) from v$session;
COUNT(*)
----------
24
SQL>
[Updated on: Tue, 31 March 2020 03:41] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: LOGON function [message #680664 is a reply to message #680655] |
Sat, 30 May 2020 11:50 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
GET_APPLICATION_PROPERTY accepts predefined set of properties. I'm not on 12c but 10g (well, not my choice, that's the way it is), and - in my version - Forms Help says that you can use USER_NLS_LANGUAGE:
Forms Help
USER_NLS_LANGUAGE Returns the current value of the language portion only of the USER_NLS_LANG environment variable defined for the form operator. If USER_NLS_LANG is not explicitly set, it defaults to the setting of NLS_LANG
Please, check your Forms Help and see what it says.
So, if you created your own variable, I don't think that built-in procedures see it just because you'd want them to. Or, if it is possible, I don't know how to do it.
A simple workaround is to create a table in the database and store your "settings" in there; then it is easy to fetch them into a form.
|
|
|
Re: LOGON function [message #680682 is a reply to message #680664] |
Sun, 31 May 2020 22:18 |
|
Shiv93
Messages: 34 Registered: September 2019
|
Member |
|
|
Hi LittleFoot,
Thanks for the reply. The workaround that you suggested can't be implemented because I'm trying to login to the form based upon that value that variable holds in the environment configuration. I dont want that value to be hardcoded in the login form and thats the reason i chose it to be in the environment configuration.
Only after login i will be able to hit the Database and fetch values.
|
|
|