Why doesn't Oracle tell you WHICH table or view does not exist?

前端 未结 8 1202
时光取名叫无心
时光取名叫无心 2021-01-31 13:43

If you\'ve used Oracle, you\'ve probably gotten the helpful message \"ORA-00942: Table or view does not exist\". Is there a legitimate technical reason the message doesn\'t incl

8条回答
  •  面向向阳花
    2021-01-31 14:28

    Reason 1: Multi-lingual interface

    There is a language-specific message configuration file for your database instance. Messages are pulled out of there and translated from the pure numeric version to the numeric+text version.

    It was probably considered better to have the hardcoded strings, than to run the risk at runtime of having a mysterious failure due to an improperly formatted "%s" string.

    (Not that I particularly agree with this POV, btw.)

    Reason 2: Security

    Right now you don't particularly expose the internal workings of your application if you print a PHP, etc, dump of an Oracle error message to the browser.

    Applications would be a bit more exposed if more detail were printed by default... For example, if citibank printed a more explanatory message.

    (see disclaimer above, I would be happy to get more information in the error as well.)

提交回复
热议问题