Home » Developer & Programmer » Forms » can i get the session information in the form.. urgently
can i get the session information in the form.. urgently [message #146719] Sun, 13 November 2005 00:48 Go to next message
ashraf_arif59
Messages: 35
Registered: March 2005
Location: Pakistan
Member

can iget the session information
story is that

i have logon from (form) with scott/tiger

i check that in v$_session table e has the information
about the scott session
it generated the new sid,logontime,user.client information

when i exit from form

in v$_session the information is also finish


i want to ask the question
can form has the information of this session and sid of this session that oracle automatically insert into v$_session?
if form has the information then how i can get it from form;
Re: can i get the session information in the form.. urgently [message #146739 is a reply to message #146719] Sun, 13 November 2005 11:39 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
First of all: V_$SESSION is a SYS object. Use the V$SESSION view instead.

As for your question, do you want to audit?

MHE
Re: can i get the session information in the form.. urgently [message #147034 is a reply to message #146739] Tue, 15 November 2005 07:42 Go to previous messageGo to next message
ashraf_arif59
Messages: 35
Registered: March 2005
Location: Pakistan
Member

thanx for giving me the reply.
but i want the session id of the form, that is running
how can i get the session id related to that form in form;
Re: can i get the session information in the form.. urgently [message #147205 is a reply to message #147034] Wed, 16 November 2005 05:28 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Use:
SYS_CONTEXT('USERENV','SESSIONID');


MHE
Re: can i get the session information in the form.. urgently [message #147508 is a reply to message #147205] Fri, 18 November 2005 00:23 Go to previous messageGo to next message
ashraf_arif59
Messages: 35
Registered: March 2005
Location: Pakistan
Member

thanx Maaher
but i have not idea how i have to this code
use :
sys_context('userenv','SESSIONID');

PLEASE GIVE ME THE DETAIL HOW I HAVE USE THIS IN FORM
Re: can i get the session information in the form.. urgently [message #147534 is a reply to message #147508] Fri, 18 November 2005 02:13 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Have you checked the manuals yet?

Oracle9i SQL Reference Release 2 (9.2)


SYS_CONTEXT ( 'namespace' , 'parameter' [, length] )

SYS_CONTEXT returns the value of parameter associated with the context namespace. You can use this function in both SQL and PL/SQL statements.

For namespace and parameter, you can specify either a string (constant) or an expression that resolves to a string designating a namespace or an attribute. The context namespace must already have been created, and the associated parameter and its value must also have been set using the DBMS_SESSION.set_context procedure. The namespace must be a valid SQL identifier. The parameter name can be any string. It is not case sensitive, but it cannot exceed 30 bytes in length.

The datatype of the return value is VARCHAR2. The default maximum size of the return value is 256 bytes. You can override this default by specifying the optional length parameter. The valid range of values is 1 to 4000 bytes. (If you specify an invalid value, then Oracle ignores it and uses the default.)

Oracle9i provides a built-in namespace called USERENV, which describes the current session.


So, it is a function returning a VARCHAR2(30) value of a given parameter. If you use USERENV, you are using the built-in namespace for the current session.

If this wouldn't work from Forms, create a function on the database side returning the parameter's value. You should be able to figure this out yourself Wink.

MHE
Re: can i get the session information in the form.. urgently [message #147551 is a reply to message #147534] Fri, 18 November 2005 03:27 Go to previous messageGo to next message
ashraf_arif59
Messages: 35
Registered: March 2005
Location: Pakistan
Member

sir sys_context is not working in oracle 8.0.5 and developer 2000
sir another option about this how to get the sessionid in the form related to that form
Re: can i get the session information in the form.. urgently [message #147566 is a reply to message #147551] Fri, 18 November 2005 04:22 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Ok, this is exactly the reason why we ask for DB version and Forms version. 8.0.5 was bug prone and is desupported quite some time now.

In your version, you still have to use the old
USERENV('SESSIONID')
function.

[edit]I just saw the 'urgently' in your title:
how can it be urgent if the version you use is desupported? No official production box runs desupported software I hope.

MHE

[Updated on: Fri, 18 November 2005 04:24]

Report message to a moderator

Re: can i get the session information in the form.. urgently [message #147777 is a reply to message #147566] Mon, 21 November 2005 00:40 Go to previous message
ashraf_arif59
Messages: 35
Registered: March 2005
Location: Pakistan
Member

thax for giving me the guidness . i have got my solution from your guidness
Previous Topic: when_validate_item trigger
Next Topic: Forms Gurus pls help??
Goto Forum:
  


Current Time: Fri Sep 20 03:26:22 CDT 2024