Page 1 of 1
Request SID with NLS params
Posted: Sat 02 May 2015 10:17
by sinys
After connect ODAC send request NLS params.
Could you please add feature at the same time with NLS params request SID?
Re: Request SID with NLS params
Posted: Tue 05 May 2015 10:20
by AlexP
Hello,
Please clarify, what exactly do you want to retrieve: the session ID or the database system identifier?
to retrieve the session ID, you can use the following query:
Code: Select all
select sys_context('userenv','sessionid') Session_ID from dual;
Re: Request SID with NLS params
Posted: Tue 05 May 2015 16:34
by sinys
Hello!
I mean sys_context('userenv','sid'). Of course I can send this request after connect, but it is additional network round-trip request. I offer add future for request SID in your NLS request.
Smth like this:
OraSession1.RequestSIDOnConnect := true;
declare cursor NlsParamsCursor is SELECT * FROM nls_session_parameters;begin SELECT Nvl(Lengthb(Chr(16777216)), Nvl(Lengthb(Chr(65536)), Nvl(Lengthb(Chr(256)), 1))), Nvl(Lengthb(Chr(1)), 1) INTO :MaxCharLength, :MinCharLength FROM dual; for NlsRecord in NlsParamsCursor loop if NlsRecord.parameter = 'NLS_DATE_LANGUAGE' then :NlsDateLanguage := NlsRecord.value; elsif NlsRecord.parameter = 'NLS_DATE_FORMAT' then :NlsDateFormat := NlsRecord.value; elsif NlsRecord.parameter = 'NLS_NUMERIC_CHARACTERS' then :NlsNumericCharacters := NlsRecord.value; elsif NlsRecord.parameter = 'NLS_TIMESTAMP_FORMAT' then :NlsTimeStampFormat := NlsRecord.value; elsif NlsRecord.parameter = 'NLS_TIMESTAMP_TZ_FORMAT' then :NlsTimeStampTZFormat := NlsRecord.value; end if; end loop;
:SID := sys_context('userenv','sid');
end;
where OraSession1.SID can return initialized SID;
of course when variable sys_context('userenv','sid') is available (oracle 10g and later).
Re: Request SID with NLS params
Posted: Wed 06 May 2015 07:51
by AlexP
SID is not related to NLS parameters. Therefore it is not quite correct to retrieve SID when retrieving these parameters.
You can leave your suggestion on our uservoice page:
https://devart.uservoice.com/forums/104 ... 915-oracle . If it gets enough user votes, we will implement it.