You've written SQL that works perfectly in SQL*Plus. You paste it into your OTBI report and immediately hit this:
"Near
The frustrating part? Your SQL looks correct. It's valid Oracle syntax. So what's the problem?
The issue is that OBIEE uses logical SQL, not physical SQL. They look similar, but they're fundamentally different languages. Understanding this distinction will eliminate 90% of your nQSError 27002 errors.
Logical SQL vs Physical SQL: The Core Difference
Physical SQL is what you write in SQL*Plus or SQL Developer โ it queries the actual database tables directly.
Logical SQL is what OBIEE uses โ it queries through the presentation layer (subject areas and folders), not the physical tables.
| Feature | Physical SQL (Oracle DB) | Logical SQL (OBIEE) |
|---|---|---|
| Join syntax | ANSI or comma joins | ANSI joins only |
| Subqueries | Supported everywhere | Must be aliased and parenthesized |
| Column references | table.column or alias.column | "Subject Area"."Folder"."Column" |
| Functions | All Oracle functions | OBIEE-supported functions only |
| Quoting | Optional, case-insensitive | Always double-quotes, case-sensitive |
When OBIEE encounters physical SQL syntax, it tries to parse it as logical SQL, and that's where the syntax error occurs.
The Most Common Cause: Comma Joins
The #1 source of nQSError 27002 is trying to use comma-separated tables (old-style joins). This works in Oracle SQL but NOT in OBIEE:
Always use explicit ANSI JOIN syntax in OBIEE. Never use comma-separated table lists.
Second Most Common: Unsupported SQL Functions
Some Oracle functions don't exist in OBIEE logical SQL. For example:
OBIEE doesn't support ROWNUM. Common unsupported functions include:
- ROWNUM
- ROW_NUMBER() OVER (PARTITION BY ...)
- CONNECT_BY
- DBMS_ functions (DBMS_METADATA, DBMS_RANDOM, etc.)
- Package functions
- Recursive CTEs (WITH ... AS ...)
Third Most Common: Subquery Syntax Issues
Subqueries in OBIEE must be properly aliased and parenthesized:
Always alias your subqueries with "AS alias_name". OBIEE requires this.
How to Fix nQSError 27002: Step-by-Step
Step 1: Identify the Token in the Error Message
The error shows which token caused the problem. Example:
The comma tells you it's a join syntax issue. Look for comma-separated tables.
Step 2: Convert to ANSI JOIN Syntax
Find any comma-separated tables and convert them to explicit JOINS:
Step 3: Check Column References
Ensure all columns use the correct subject area and folder paths:
Step 4: Replace Unsupported Functions
If the error mentions a function, check if it's supported by OBIEE. Use OBIEE alternatives:
| Unsupported | OBIEE Alternative |
|---|---|
| ROWNUM | ROW_NUMBER() or LIMIT clause (if supported) |
| CAST | Use OBIEE column casting in presentation layer |
| TO_CHAR with date formats | Use OBIEE date formatting functions |
| Package functions | Create a database view and expose it |
Real-World Example: Converting Physical to Logical SQL
Scenario: Pull all active employees hired in the last 90 days with their current salary.
Key changes:
- Removed comma joins, added explicit INNER JOINs
- Removed ROWNUM (not supported)
- Used double quotes and proper column paths
- Replaced TRUNC(SYSDATE) with CURRENT_DATE
Prevention: Write OBIEE-First SQL from the Start
- Always use ANSI JOIN syntax โ Never comma-separated tables
- Always quote identifiers โ Use "Subject_Area"."Column"
- Always alias subqueries โ (SELECT ...) AS alias
- Test in the OBIEE Answer Editor first โ Before using in reports
- Check function support โ Verify any non-standard function works in OBIEE
Need to Reference Oracle HCM Tables in Your Query?
Search our database of 35,000+ Oracle Fusion Cloud tables. Find exact table names, column structures, and subject area mappings for your OTBI reports.
Search Oracle HCM Tables โSummary
nQSError 27002 happens when you write physical SQL (Oracle syntax) instead of logical SQL (OBIEE syntax). The three main culprits are:
- Comma joins โ Use ANSI JOIN syntax
- Unsupported functions โ Check OBIEE function support
- Unaliased subqueries โ Always add "AS alias_name"
Remember: OBIEE doesn't query the database directly; it queries the metadata layer. Write for the metadata layer, not the physical tables.