0

I don't know everything about Oracle Apex yet, but When I run this code in Oracle developer it runs just as fine, but when I am using Oracle Apex and making an application through an sql query it gives me the error:

• Query cannot be parsed, please check the syntax of your query.

with x as (
select count(cou_code) as changes, state_code from sdrp15_submission_log sl
where state_code in (select distinct state_code from sdrp15_submission_log
 where state_code = sl.state_code
 and cou_code != 'All')
and qa_date is null
and phase = 'A' 
group by state_code)
, y as (select count(cou_code) as cnt, st_code
from sdrp15_cosd
where st_code = (select distinct state_code 
 from sdrp15_submission_log
 where state_code = st_code
 and cou_code = 'All'
 and phase = 'A'
 and qa_date is null)
and phase = 'A'
group by st_code)
select x.state_code, x.changes+y.cnt
from x join y on x.state_code = Y.st_code
asked Sep 10, 2015 at 13:15
2
  • Is there more to the error message than "Query cannot be parsed, please check the syntax of your query"? Commented Sep 10, 2015 at 14:06
  • It says" table or view does not exist, but that doesn't make sense since it runs in my sql developer. Commented Sep 10, 2015 at 14:15

1 Answer 1

1

Check the parsing schema of your APEX application. The tables and are probabaly owned by a schema other than the default parsing schema of your APEX application.

If the parsing schema of your APEX application has the required privileges to access the required tables and views, you may be able to get it working by prepending the objects owner schema name to the object for example: My_Table would become SomeSchema.My_Table.

Or you could create synonyms to the tables and views in the parsing schema referencing the objects in the owners schema:

create synonym My_Table for SomeSchema.My_Table;
answered Sep 10, 2015 at 17:12
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.