We have an application that has been written to insert a variable that is char(50) into a column that is defined as char(40). In Oracle 11g (I know this is very old) it would merely truncate the last 10 characters without issue. However, Oracle 19c doesn't allow this and raises an exception (which I believe should've always been the case). Where can I find documentation of this restriction and when it was changed and is there away around this other than changing the program code?
Oracle 11 truncated that extra 10 characters in the below statemt
ADBBGNX_ADDRESS_LINE_1 := agentrecord.producerrec.businessAddressLine1;
Oracle 19 throws an exception with a NULL error status.
Can we get some more context - I can't reproduce on any version
SQL> select banner from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
SQL> variable x char(40)
SQL> exec :x := rpad('a',50,'a')
PL/SQL procedure successfully completed.
SQL> print x
X
------------------------------------------------------------------------------------
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SQL> variable y char(50)
SQL> exec :y := rpad('a',50,'a')
PL/SQL procedure successfully completed.
SQL> print y
Y
------------------------------------------------------------------------------------
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SQL> exec :x := :y
PL/SQL procedure successfully completed.
SQL> select banner from v$version;
BANNER
----------------------------------------------------------------------------
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
SQL> variable x char(40)
SQL> exec :x := rpad('a',50,'a')
PL/SQL procedure successfully completed.
SQL> print x
X
----------------------------------------------------------------------------
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SQL> variable y char(50)
SQL> exec :y := rpad('a',50,'a')
PL/SQL procedure successfully completed.
SQL> print y
Y
----------------------------------------------------------------------------
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SQL> exec :x := :y
PL/SQL procedure successfully completed.
</code>