2

I am currently running a very long script in Oracle for our production but we are having discrepancies in the data.

As I checked the views that the script is using (I am using Toad), I see an X mark beside the view name, then I saw an option to compile it.

I am wondering if what does a compile in a view means? Is the view not updated which causes discrepancy in the data?

2

If you ALTER a table that is referenced by a view, or even DROP a table, the view is marked as invalid and can't be accessed even if the changes to the table(s) would not make the view's code incorrect.

In that case the view needs to be re-compiled:

ALTER VIEW some_view COMPILE;

More details in the manual:
https://docs.oracle.com/database/121/SQLRF/statements_4004.htm#SQLRF01104

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.