PLS-00320:创建过程时,此表达式的类型声明不完整或格式不正确



下面的代码是创建一个传递一些值的过程,然后在_no_tiers times 中执行插入操作

CREATE OR REPLACE PROCEDURE INSERT_TIER_INFO(in_lp_code IN VARCHAR2 , in_tier IN VARCHAR2 , in_pts_reqd IN VARCHAR2 , in_multiplier IN VARCHAR2 , in_no_tiers NUMBER)
AS
low_bound NUMBER := 0 ;
current_tier VARCHAR2(32) ;
current_points NUMBER ;
current_multiplier NUMBER ;
upper_bound NUMBER := in_no_tiers ;
curr_level NUMBER := 0 ;
seperator VARCHAR2(2) := "," ;
BEGIN
FOR j IN low_bound..upper_bound LOOP
current_tier  := split(in_tier , seperator , j) ;
current_points := TO_NUMBER(split(in_pts_reqd , seperator , j)) ;
current_multiplier := TO_NUMBER(split(in_pts_reqd , seperator , j)) ;
INSERT INTO TIERED_LOYALTY_PROGRAM(LP_CODE, STATE,TIER1,POINTS_REQUIRED, MULTIPLIER, LEVEL1)
VALUES (in_lp_code , 0 , current_tier  , current_points , current_multiplier , j) ;
END LOOP;
END;

此过程调用另一个自定义函数split,它将采用字符串形式的值,例如:"R1,R2,R3",并根据func中的第三个参数是0、1还是2返回"R1"、"R2"或"R3"。此函数运行正常,但过程引发了许多错误

Errors: PROCEDURE INSERT_TIER_INFO
Line/Col: 9/12 PL/SQL: Item ignored
Line/Col: 9/28 PLS-00201: identifier ',' must be declared
Line/Col: 13/2 PL/SQL: Statement ignored
Line/Col: 13/35 PLS-00320: the declaration of the type of this expression is incomplete or malformed
Line/Col: 14/3 PL/SQL: Statement ignored
Line/Col: 14/51 PLS-00320: the declaration of the type of this expression is incomplete or malformed
Line/Col: 15/2 PL/SQL: Statement ignored
Line/Col: 15/54 PLS-00320: the declaration of the type of this expression is incomplete or malformed

您的问题从这里开始:

Line/Col: 9/12 PL/SQL: Item ignored
Line/Col: 9/28 PLS-00201: identifier ',' must be declared

这是一行代码:

seperator VARCHAR2(2) := "," ;

使用单引号来标识字符串值。双引号用于对象标识符或列别名。

seperator VARCHAR2(1) := ',' ;

最新更新