Subject Re: SQL names for user and role
Author dianeb77@hotmail.com
--- In IB-Architect@y..., "Claudio Valderrama C." <cvalde@u...> wrote:
> Hello.
> Is there any name for accessing both user_name and user_role in
standard
> SQL?
> If there're, are they named current_user and current_role, for
example?

Yes, SQL99 has CURRENT_ROLE, CURRENT_USER .. as well as SESSION_USER,
SYSTEM_USER, USER.
USER and CURRENT_USER are equivalent (except for levels of conformance
[... think "baggage"]); SESSION_USER is basically the user that
established the connection; SYSTEM_USER is basically operating system
user who caused connection to be established. More or less.

CURRENT_ROLE is new in SQL99 (roles are new in SQL99); the others also
existed in SQL92. In SQL92, support for USER was required for Entry
level conformance; support for the others was required for
Intermediate level.

In SQL99, support for USER is required for Core SQL conformance;
support for CURRENT_USER, SESSION_USER, SYSTEM_USER is only required
for conformance to Feature F321, ``User authorization''; support for
CURRENT_ROLE is only required for conformance to Feature T332,
``Extended roles''. I forget which (if any) conformance package those
are in.
[And I don't care enough to check ... SQL99 conformance could possibly
be made more complicated and/or less useful, but I don't know how.]

I can't imagine that it does, but hope that helps,
db