简体   繁体   中英

ORA-06502: PL/SQL: numeric or value error: character string buffer too small: When building a model

I am trying to build a naive bayes model using oracle SQL. I am able to build, compile and view the results of the classified values, however, when trying to build a confusion matrix and view the accuracy I get the following error:

Error report -
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_DATA_MINING", line 2618
ORA-06512: at line 4
06502. 00000 -  "PL/SQL: numeric or value error%s"
*Cause:    An arithmetic, numeric, string, conversion, or constraint error
           occurred. For example, this error occurs if an attempt is made to
           assign the value NULL to a variable declared NOT NULL, or if an
           attempt is made to assign an integer larger than 99 to a variable
           declared NUMBER(2).
*Action:   Change the data, how it is manipulated, or how it is declared so
           that values do not violate constraints.

The Code I used for building the matrix is the following:

DECLARE
   v_accuracy NUMBER;
BEGIN
DBMS_DATA_MINING.COMPUTE_CONFUSION_MATRIX (
   accuracy => v_accuracy,
   apply_result_table_name => 'demo_class_nb_test_results',
   target_table_name => 'BankDataTest',
   case_id_column_name => 'ID',
   target_column_name => 'Y',
   confusion_matrix_table_name => 'demo_class_nb_confusion_matrix1',
   score_column_name => 'PREDICTED_VALUE',
   score_criterion_column_name => 'PROBABILITY',
   cost_matrix_table_name => null,
   apply_result_schema_name => null,
   target_schema_name => null,
   cost_matrix_schema_name => null,
   score_criterion_type => 'PROBABILITY');
   DBMS_OUTPUT.PUT_LINE('**** MODEL ACCURACY ****: ' || ROUND(v_accuracy,4));
END;

Can someone explain why I could get an error like this?

I figured out the reason for this error, It's due to the length of the table name used in confusion_matrix_table_name being too long. Therefore simply reduce the name length and it works.

Change: confusion_matrix_table_name => 'demo_class_nb_confusion_matrix1',

To: confusion_matrix_table_name => 'nb_confusion_matrix',

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM