Problem with SYS_CONTEXT in WHERE clause in 10g
655592Aug 19 2008 — edited Aug 20 2008I am running the following SELECT statement in 9i and 10g
SELECT COUNT(*)
FROM mapinfo.mapinfo_mapcatalog
WHERE tablename IN ('ESU_GRAPHICS', 'STREETS', 'ASD_STREETS', 'NSG_ARCHIVE_ESU_GRAPHICS')
AND ownername = sys_context('USERENV','CURRENT_SCHEMA');
When running in 9i it returns 4, the correct answer, but in 10g it always returns 0. I have tried populating a variable with the result from sys_context('USERENV','CURRENT_SCHEMA') such as:
SELECT sys_context('USERENV','CURRENT_SCHEMA')
INTO currentschema
FROM dual;
I have checked the variable and it is giving me the correct result in 10g, but I still get 0 returned from the select statement.
What am I missing to get this working in 10g?
Cheers
Sean