ORA-06502:PL/SQL:错误:字符到数字转换错误

问题描述 投票:0回答:1

我在执行这个 PLSQL 时遇到问题: 我已经尝试过,但似乎没有什么对我有用。

我的 PLSQL 是这样的:

SET SERVEROUTPUT ON
declare
l_api_version           NUMBER ;
l_init_msg_list         VARCHAR2(1000);
l_commit                VARCHAR2(1000);
l_validation_level      NUMBER  ;
l_customer_trx_id       ra_customer_trx.customer_trx_id%type;
lx_return_status        VARCHAR2(1000);
lx_msg_count            NUMBER;
lx_msg_data             VARCHAR2(2000);

L_TIPO NUMBER;
L_GCC NUMBER;
L_NC_ID NUMBER := 4855753;
begin

MO_GLOBAL.SET_POLICY_CONTEXT('S',281);
fnd_global.APPS_INITIALIZE(user_id=>7028,resp_id=>51944,resp_appl_id=>222);

DBMS_OUTPUT.PUT_LINE('NOT COMPLETE');

select  cust_trx_type_id , TO_NUMBER(GL_ID_REC) 
INTO L_TIPO,L_GCC
from ra_cust_trx_types_all where NAME = 'NC B 0018 VI Closed';


AR_TRANSACTION_GRP.INCOMPLETE_TRANSACTION(
      p_api_version           =>'1.0',
      p_init_msg_list         =>fnd_api.g_true,
      p_commit                =>fnd_api.g_true,
      p_validation_level      =>fnd_api.g_valid_level_none,
      p_customer_trx_id       =>L_NC_ID,
      x_return_status         =>Lx_return_status,
      x_msg_count             =>Lx_msg_counT,
      x_msg_data              =>Lx_msg_data);

DBMS_OUTPUT.PUT_LINE('Lx_return_status '||Lx_return_status);
DBMS_OUTPUT.PUT_LINE('Lx_msg_counT '||Lx_msg_counT);
DBMS_OUTPUT.PUT_LINE('Lx_msg_data '||Lx_msg_data);

IF Lx_return_status = 'S' THEN

  update ra_customer_trx_all 
     set cust_trx_type_id = L_TIPO,
         doc_sequence_value =L_NC_ID
   where customer_trx_id = L_NC_ID;

   UPDATE RA_CUST_TRX_LINE_GL_DIST_ALL 
      SET CODE_COMBINATION_ID = L_GCC
    WHERE CUSTOMER_tRX_ID = L_NC_ID
      AND ACCOUNT_CLASS = 'REC';

DBMS_OUTPUT.PUT_LINE('COMPLETO');

AR_TRANSACTION_GRP.COMPLETE_TRANSACTION(
      p_api_version           =>'1.0',
      p_init_msg_list         =>fnd_api.g_true,
      p_commit                =>fnd_api.g_true,
      p_validation_level      =>fnd_api.g_valid_level_none,
      p_customer_trx_id       =>L_NC_ID,
      x_return_status         =>Lx_return_status,
      x_msg_count             =>Lx_msg_counT,
      x_msg_data              =>Lx_msg_data);


DBMS_OUTPUT.PUT_LINE('Lx_return_status '||Lx_return_status);
DBMS_OUTPUT.PUT_LINE('Lx_msg_counT '||Lx_msg_counT);
DBMS_OUTPUT.PUT_LINE('Lx_msg_data '||Lx_msg_data);

  update ra_customer_trx_all 
     set doc_sequence_value =NULL
   where customer_trx_id = L_NC_ID;

      
END IF;      
      
COMMIT;

end;

收到此错误消息:

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.

它在第 26 行出现错误,该行是空的,下面这句话: AR_TRANSACTION_GRP.INCOMPLETE_TRANSACTION(.

我错过了什么?我做错了什么吗?

sql plsql
1个回答
0
投票

二手p

_api_version           =>1.0,
而不是
p_api_version           =>'1.0'
并且有效:)

© www.soinside.com 2019 - 2024. All rights reserved.