What could go wrong right? For one thing, some of the saved reports were throwing an ORA-01427 error and some were not. Even worse, the view did not have any errors and running the query in SQLDeveloper did not result in errors.
select
*
from
some_view;
Eventually we found the problem. SQLDeveloper shows the first 50 records. It's very possible that an error takes place in a result set which is not shown. In our case the view was something like:
select p.last_name
,
p.
first_name
,
p.
date_of_birth
,
p.
city
, (
select
c.country
from cities c
where c.city_name = p.city
) country
from persons p;
So I guess the lesson learned is, that when you have select statements in the select part of your query, you should make sure to return all rows when debugging.Oooorrrr... like my mentor Frank would say: "Don't put a select in the select part of your query!".
No comments:
Post a Comment