Oracle implicit conversion warning

Viewed 132

Is there any way how to force PL/SQL compiler to tell me (using a compilation hint or an error) that I am trying to put a string into an integer? In some cases, the implicit conversion will handle it for me, but I don't want that. I always want to know that there is a type mismatch.

Best regards, Tom

1 Answers

You can enable compiler warnings for compiled PL/SQL with

alter session set plsql_warnings='enable:all';

The particular warning for implicit conversion is PLW-07204, which you can enable on its own with:

alter session set plsql_warnings='enable:7204';

DBFiddle

This will only notify you about implicit conversion happening inside static SQL statements where the conversion could go either way and cause a performance problem.

Related