Home > Software engineering >  Is it possible to validate all SQL expressions in application?
Is it possible to validate all SQL expressions in application?

Time:11-20

When importing project, there are a lot of bad table names referenced from application, which causes errors. I need to manually rename or create tables accordingly. It would be fine if i find all bad SQL expressions in application with simple few clicks.

How to validate all SQL expressions from pages content body, pages items, etc. to see at what places there are errors?

EDIT:

Series

Wrong Table

Here: Table SAMPLE$PROJECT_TASKS does not exist and was not find by Advisor.

CodePudding user response:

Use Advisor. It is located in application's Utilities.

For example:

  • I created a table named brisime
  • then I created an interactive report based on that table (it worked OK)
  • went to SQL Workshop and dropped the table
  • interactive report doesn't work any more (of course it doesn't)

So, what does the Advisor say? I included only "Is valid SQL or PL/SQL code":

enter image description here

The result is then:

enter image description here

As expected; table doesn't exist, and Advisor found it.


[EDIT]

As of your comment that chart's series query isn't checked by the Advisor: I don't know why - maybe you should ask people who developed Apex (visit OTN Forums).

However, just for testing purposes, I created a page that has two regions:

  • chart
  • classic report

Both used the same table as a source. I then dropped the table and ran the page in Debug mode. It shows two separate debug identifiers

  • chart uses ajax plugin path
  • classic report uses show path

The Advisor says that report failed on "Is Valid SQL or PL/SQL Code" check, but nothing for the chart. Maybe it is about Ajax, i.e. it isn't checked. On the other hand, maybe it is not the reason, I really can't tell.

  • Related