Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Finding possible data type conversion issues in views

Jochen BandhauerJun 13 2025

Hello,

is there a way to detect possible data type conversion issues in views similar to the way PL/SQL shows a warning (PLW-07204)?

Testcase:

SQL> alter session set plsql_warnings='ENABLE:ALL';

Session altered.

SQL> create table t1 (a varchar2(10));

Table T1 created.

SQL> create table t2 (a nvarchar2(10));

Table T2 created.

SQL> create view v1 as (select t1.a from t1, t2 where t1.a=t2.a);

View V1 created.

SQL> create or replace procedure p1 as
  2  var1 varchar2(10);
  3  begin
  4  select t1.a into var1 from t1, t2 where t1.a=t2.a;
  5  end;
  6* /

Procedure P1 compiled

LINE/COL  ERROR
--------- -------------------------------------------------------------
1/1       PLW-05018: unit P1 omitted optional AUTHID clause; default value DEFINER used
4/41      PLW-07204: conversion away from column type may result in sub-optimal query plan
SQL>

I also tried the SQL Developer(Data Modeler), but it didn't show the relationship from views to base table columns including data types.

Thanks

Jochen

This post has been answered by James Su on Jun 13 2025
Jump to Answer
Comments
Post Details
Added on Jun 13 2025
4 comments
181 views