2. check if the JOIN syntax is correct;
3. check if one of the columns use in JOIN has only NULL values;
4. check if the constraints used in WHERE clause causes makes sense (e.g. wrong values or syntax);
5. for Oracle flavored queries, check if in WHERE clause there is a column not referenced with the table name or alias, and the column is available in more than one table used in the query. This Oracle bug is really dangerous when doing fast query checks!
6. for Oracle (APPS), check whether the query or view uses USERENV function with LANG or LANGUAGE text parameter, normally a constraint like:
TABLE1.LANGUAGE = USERENV(‘LANG’).
The problem with such queries comes when user’s system language is other than the one expected, and thus query’s output might not be as expected. Usually it is preferable to hardcode the value, when possible:
TABLE1.LANGUAGE = ‘US’
Note:
Actually, also the tools you are using to run a query could create issues, for example a query run under Oracle’s SQL Developer was not returning records even if in TOAD did that. The problem was solved with the installation of a newer SQL Developer version.
No comments:
Post a Comment