on 04-19-2019 4:27 PM
I have a query with a subquery that will execute correctly in SQL Developer. For some reason, running the same query in IDT will generate an Invalid Query [ORA-009000] error.
I've tried three ways of representing the query in IDT.
1) As a filter object (in the business layer):
CMS_FOLDER.SNAPSHOT_ID =
(
SELECT Max(SNAPSHOT_ID)
FROM EYE_SNAPSHOT
WHERE SNAPSHOT_NAME = 'CMS'
AND SNAPSHOT_RESULT = '1'
)
2) As a filter on the CMS_FOLDER table (in the data foundation):
CMS_FOLDER.SNAPSHOT_ID =
(
SELECT Max(SNAPSHOT_ID)
FROM EYE_SNAPSHOT
WHERE SNAPSHOT_NAME = 'CMS'
AND SNAPSHOT_RESULT = '1'
)
3) As a derived table (in the data foundation):
SELECT *
FROM CMS_FOLDER
WHERE
(
CMS_FOLDER.SNAPSHOT_ID =
(
SELECT Max(SNAPSHOT_ID)
FROM EYE_SNAPSHOT
WHERE SNAPSHOT_NAME = 'CMS'
AND SNAPSHOT_RESULT = '1'
)
)
Oddly enough, the derived-table option works correctly in UDT.
The data-foundation in IDT is marked as ANSI92=Yes.
What is the problem with IDT?
Hi Craig,
Instead of using * (asterisk) in the outer query, list out all the columns, that should do the trick.
Thanks,
Mahboob Mohammed
SELECT Col1, Col2, Col3,... ColN
FROM CMS_FOLDER
WHERE(
CMS_FOLDER.SNAPSHOT_ID =(SELECTMax(SNAPSHOT_ID)FROM EYE_SNAPSHOT
WHERE SNAPSHOT_NAME ='CMS'AND SNAPSHOT_RESULT ='1'))<br>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you cut and paste the SQL text, sometimes they contain hidden characters (CR, LF).
Therefore, try writing the SQL in one line to make sure none (CR, LF) are included.
Also, make sure that the character ' is correct (it changed when copying and pasting).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a new data foundation, added the table and the filter, and I was able to see the table's values. By the way, the ANSI92 setting had no effect.
Either 1) the DF was corrupted or 2) there's a bug in IDT. I'm guessing that #2 is more likely.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.