Solved
Numeric or value error: character string buffer too small
Why do I get "Numeric or value error: character string buffer too small" error in the application?
Best answer by Sahan Udana
Hi Nayomi,
This is a one possible explanation of this error can be occur.
"numeric or value error: character string buffer too small" error can occur if the size of the variable get exceeded. If this is not the scenario could be a probable cause for the issue.
If the database parameter NLS_LENGTH_SEMANTICS if this value is set to ‘Byte’ this error will occur. This parameter can be mostly change if we are using sql developer tool to which this parameter is set to default to Byte. If we compile packages setting this parameter value to 'BYTE' error could occur.
In sql developer we can do the following to check this. Go to sql developer (Tools/Preferences/Database/NLS). Change it to ‘CHAR’ .
to change incorrect value this needs to be used:
ALTER SESSION SET NLS_LENGTH_SEMANTICS=CHAR;
(Check image1)
To fix the issue need to recompile the invalid packages after changing the parameter to 'CHAR'.
To check any other package’s compiles incorrectly run this query .
To check Views
How to Fix it?
Need to recompile the wrong packages .
View originalThis is a one possible explanation of this error can be occur.
"numeric or value error: character string buffer too small" error can occur if the size of the variable get exceeded. If this is not the scenario could be a probable cause for the issue.
If the database parameter NLS_LENGTH_SEMANTICS if this value is set to ‘Byte’ this error will occur. This parameter can be mostly change if we are using sql developer tool to which this parameter is set to default to Byte. If we compile packages setting this parameter value to 'BYTE' error could occur.
In sql developer we can do the following to check this. Go to sql developer (Tools/Preferences/Database/NLS). Change it to ‘CHAR’ .
to change incorrect value this needs to be used:
ALTER SESSION SET NLS_LENGTH_SEMANTICS=CHAR;
(Check image1)
To fix the issue need to recompile the invalid packages after changing the parameter to 'CHAR'.
To check any other package’s compiles incorrectly run this query .
code:
SELECT name, owner, 'CASE type WHEN 'PACKAGE' then 'PACKAGE ' || owner || '.' || name || ' COMPILE' WHEN 'PACKAGE BODY' then 'PACKAGE ' || owner || '.' || name || ' COMPILE BODY'
ELSE type || ' ' || owner || '.' || name || ' COMPILE'
END sql_stmt
FROM all_plsql_object_settings
WHERE owner in ('IFSINFO', 'IFSAPP')
AND nls_length_semantics = 'BYTE'
ORDER BY type;
To check Views
code:
select ut.table_name, ut.tablespace_name, ut.status, utc.COLUMN_NAME, utc.DATA_TYPE, utc.CHAR_USED
from user_tables ut, user_tab_cols utc
where utc.TABLE_NAME = ut.TABLE_NAME
and utc.DATA_TYPE = 'VARCHAR2'
and utc.CHAR_USED = 'B'
order by ut.table_name, utc.COLUMN_NAME;
How to Fix it?
Need to recompile the wrong packages .
code:
Ex: ALTER PACKAGE work_order_role_api COMPILE;
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.