Home » Developer & Programmer » Forms » LOGON function (Oracle form 12c )
LOGON function [message #678283] Sat, 23 November 2019 03:12 Go to next message
Shiv93
Messages: 18
Registered: September 2019
Junior 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 #678284 is a reply to message #678283] Sat, 23 November 2019 03:48 Go to previous messageGo to next message
Michel Cadot
Messages: 66794
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Here?

Re: LOGON function [message #678293 is a reply to message #678284] Sat, 23 November 2019 06:41 Go to previous messageGo to next message
Shiv93
Messages: 18
Registered: September 2019
Junior Member
HI ,
i guess i will elaborate it more on whats my requirements.

I have an database and my form is currently getting connected to it in the schema level(i.e username & pwd is my schema name) but when im trying to use my user id am not able to get through.


cs = my database name;
LOGON (uname, pwd || '@' || cs, FALSE);
Re: LOGON function [message #678306 is a reply to message #678293] Sat, 23 November 2019 18:17 Go to previous messageGo to next message
BlackSwan
Messages: 26649
Registered: January 2009
Location: SoCal
Senior Member
Sivachandran wrote on Sat, 23 November 2019 04:41
HI ,
i guess i will elaborate it more on whats my requirements.

I have an database and my form is currently getting connected to it in the schema level(i.e username & pwd is my schema name) but when im trying to use my user id am not able to get through.


cs = my database name;
LOGON (uname, pwd || '@' || cs, FALSE);

There are two problems with post above.
1) We don't know what actual code is contained in LOGON function above.
2) We don't know what actual error gets throw & reported by you as "not able to get through".

Since we don't know what you really do or how Oracle DB responds we can't begin to speculate what is wrong or how to fix it.
Re: LOGON function [message #678325 is a reply to message #678306] Sun, 24 November 2019 15:30 Go to previous messageGo to next message
Littlefoot
Messages: 21530
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 Go to previous messageGo to next message
Shiv93
Messages: 18
Registered: September 2019
Junior 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 #678335 is a reply to message #678329] Mon, 25 November 2019 04:07 Go to previous messageGo to next message
cookiemonster
Messages: 13781
Registered: September 2008
Location: Rainy Manchester
Senior Member
In oracle schema=user.
You seem to think otherwise.
So what is user to you?
Re: LOGON function [message #678336 is a reply to message #678306] Mon, 25 November 2019 04:15 Go to previous messageGo to next message
cookiemonster
Messages: 13781
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 #678434 is a reply to message #678336] Tue, 03 December 2019 13:12 Go to previous messageGo to next message
Shiv93
Messages: 18
Registered: September 2019
Junior Member
Hi Cookiemonster,

Thanks for your reply..

My problem is I have a DB with multiple schema say for example schema_1, schema_2,schema_3 and my default schema is schema_1.

So when I'm connecting with my user ID it's getting me connected to the default taht is schema_1.
LOGON (Username, pwd || '@' || 'DB', FALSE);

So is there anyway that I can connect my user ID to other schema like schema_2 or schema_3..
Re: LOGON function [message #678439 is a reply to message #678335] Wed, 04 December 2019 03:58 Go to previous message
cookiemonster
Messages: 13781
Registered: September 2008
Location: Rainy Manchester
Senior Member
cookiemonster wrote on Mon, 25 November 2019 10:07
In 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>

Previous Topic: SQL Vs Oracle Forms Performance issue
Next Topic: Forms 10g: builder crash while opening a Form even first connect (ctrl+j)
Goto Forum:
  


Current Time: Thu Jan 23 15:36:07 CST 2020