真的很激動知道櫃面你真的得到了error
你在你的問題中提到。
理想情況下,你必須得有這樣的:
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00221: 'PARSE_MSG' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
可是你貼:
Error que empieza en la línea: 1 del comando :
BEGIN P_MSG_HOTEL.parse_msg(596210657, '@S,358639058787154;E,10;D,05102017145210,05102017145210;G,4046393,51206983,258,8;M,4709;S,0;IO,1,0,0;DI,79DEAD60'); END;
Informe de error -
ORA-06550: línea 1, columna 126:
PLS-00306: wrong number or types of arguments in call to 'PARSE_MSG'
ORA-06550: línea 1, columna 126:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
這看起來安靜的誤導。
我做了下面的演示來展示我的意思。
CREATE OR REPLACE PACKAGE P_MSG_HOTEL
AS
FUNCTION parse_msg (p_id IN NUMBER, p_msg IN VARCHAR2)
RETURN NUMBER;
END;
/
CREATE OR REPLACE PACKAGE BODY P_MSG_HOTEL
AS
FUNCTION parse_msg (p_id IN NUMBER, p_msg IN VARCHAR2)
RETURN NUMBER
IS
BEGIN
RETURN 1;
END;
END;
在執行時,你表現出的方式給出了說錯誤:
EXECUTE P_MSG_HOTEL.parse_msg(596210657,
'@S,358639058787154;E,10;D,05102017145210,05102017145210;G,4046393,51206983,258,8;M,4709;S,0;IO,1,0,0;DI,79DEAD60');
錯誤
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00221: 'PARSE_MSG' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
這顯然意味着Oracle
無法識別您的功能,同時執行。 但是,當我喜歡:
SQL>
select P_MSG_HOTEL.parse_msg(596210657, '@S,358639058787154;E,10;D,05102017145210,05102017145210;G,4046393,51206983,258,8;M,4709;S,0;IO,1,0,0;DI,79DEAD60') as col
from dualSQL> 2
3/
COL
----------
1
我得到的輸出。
或者如果我使用Anonymous塊,我會得到結果。
SQL> DECLARE
x NUMBER;
BEGIN
x :=
P_MSG_HOTEL.parse_msg (
596210657,
'@S,358639058787154;E,10;D,05102017145210,05102017145210;G,4046393,51206983,258,8;M,4709;S,0;IO,1,0,0;DI,79DEAD60');
2 DBMS_OUTPUT.put_line (x);
END;
/
1
PL/SQL procedure successfully completed.
SQL>
因此,簡而言之,您不能以您執行的方式使用函數。