Return-Path: <ml-errors@fatcity.com>
Received: from ensim.rackshack.net (root@localhost)
 by orafaq.net (8.11.6/8.11.6) with ESMTP id hABK5Wj01950
 for <oracle-l@orafaq.net>; Tue, 11 Nov 2003 14:05:32 -0600
X-ClientAddr: 66.27.56.213
Received: from www2.fatcity.com (rrcs-west-66-27-56-213.biz.rr.com [66.27.56.213])
 by ensim.rackshack.net (8.11.6/8.11.6) with ESMTP id hABK5Vc01945
 for <oracle-l@orafaq.net>; Tue, 11 Nov 2003 14:05:31 -0600
Received: (from root@localhost)
 by www2.fatcity.com (8.11.6/8.11.6) id hABHBWI22158
 for oracle-l@orafaq.net; Tue, 11 Nov 2003 09:11:32 -0800
Received: by fatcity.com (05-Jun-2003/v1.0g-b73/bab) via fatcity.com id 005D6560; Tue, 11 Nov 2003 09:14:32 -0800
Message-ID: <F001.005D6560.20031111091432@fatcity.com>
Date: Tue, 11 Nov 2003 09:14:32 -0800
To: Multiple recipients of list ORACLE-L <ORACLE-L@fatcity.com>
X-Comment: Oracle RDBMS Community Forum
X-Sender: Chris Stephens <ChrisStephens@affina.com>
Sender: ml-errors@fatcity.com
Reply-To: ORACLE-L@fatcity.com
Errors-To: ML-ERRORS@fatcity.com
From: Chris Stephens <ChrisStephens@affina.com>
Subject: SQL comparison question...
Organization: Fat City Network Services, San Diego, California
X-ListServer: v1.0g, build 73; ListGuru (c) 1996-2003 Bruce A. Bergman
Precedence: bulk
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit



This is part of a row-level security implementation:

For some reason the following comparison works but currently it isn't:

  1  SELECT count(*)
  2      FROM global.client_dim a
  3*     WHERE sys_context('userenv','session_user') = trim(a.REPORTS_LOGIN)
SQL> /

  COUNT(*)
----------
         0

SQL> select sys_context('userenv','session_user') from dual;

SYS_CONTEXT('USERENV','SESSION_USER')
----------------------------------------------------------------------------
----
REPORTS_DELTA

SQL> select reports_login
  2  from global.client_dim
  3  where reports_login='REPORTS_DELTA';

REPORTS_LOGIN
------------------------------
REPORTS_DELTA


I thought maybe it was due to hidden characters so I tried:

SQL> select '|'||sys_context('userenv','session_user')||'|' from dual;

'|'||SYS_CONTEXT('USERENV','SESSION_USER')||'|'
----------------------------------------------------------------------------
----
|REPORTS_DELTA|

SQL> select '|'||reports_login||'|'
  2  from global.client_dim
  3  where reports_login='REPORTS_DELTA';

'|'||REPORTS_LOGIN||'|'
--------------------------------
|REPORTS_DELTA|

...that doesn't appear to be it.

any ideas?


Thanks for any help!

Chris
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Chris Stephens
  INET: ChrisStephens@affina.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

