Ich erhalte diese Fehlermeldung:
ORA-06502: PL/SQL: Zahlen- oder Wertfehler: Fehler bei der Umwandlung von Zeichen in Zahlen ORA-06512: in Zeile 146 06502. 00000 - "PL/SQL: numerischer oder Wert-Fehler%s"
Und hier ist mein Code:
SET SERVEROUTPUT ON;
DECLARE
SearchId NUMBER := 0;
SearchMethod VARCHAR2(100) := '';
CritExpression VARCHAR2(100) := '';
SubstringStartPosition NUMBER := 0;
SubstringLength NUMBER := 0;
CritDescription VARCHAR2(100) := '';
CriteriaSequenceId NUMBER := 1;
CriteriaId NUMBER := 0;
CritCount NUMBER := 0;
FUNCTION InsertSrchCriteria
(
SearchMethod IN VARCHAR2,
CritExpression IN VARCHAR2,
SubstringStartPosition IN NUMBER,
SubstringLength IN NUMBER,
CritDescription IN VARCHAR2,
CriteriaSequenceId IN NUMBER,
SearchId IN NUMBER
)
RETURN NUMBER
IS
C_Id NUMBER := 0;
BEGIN
SELECT COUNT (*) INTO CritCount FROM criteria_table WHERE search_id = SearchId AND criteria_sequence_id = CriteriaSequenceId;
IF CritCount = 0
THEN
INSERT INTO criteria_table
(
criteria_sequence_id,
search_id,
search_method,
expression,
substring_start_position,
substring_length,
description
)
VALUES
(
CriteriaSequenceId,
SearchId,
SearchMethod,
CritExpression,
SubstringStartPosition,
SubstringLength,
CritDescription
)
RETURNING criteria_id INTO C_Id;
IF C_Id > 0
THEN
DBMS_OUTPUT.PUT_LINE ('Inserted ' || 'SearchId: ' || SearchId || ' @' || CriteriaSequenceId || ' successfully');
ELSE
DBMS_OUTPUT.PUT_LINE ('Not Inserted ' || 'SearchId: ' || SearchId || ' @' || CriteriaSequenceId);
END IF;
ELSE
DBMS_OUTPUT.PUT_LINE ('Already exists ' || 'SearchId: ' || SearchId || ' @' || CriteriaSequenceId);
END IF;
RETURN C_Id;
END InsertSrchCriteria;
BEGIN
SearchId = 5;
CriteriaSequenceId := 1;
SearchMethod := 'XPath';
CritExpression := '//Expression/text()';
SubstringStartPosition := null;
SubstringLength := null;
CritDescription := '';
CriteriaId := InsertSrchCriteria ****
(
CriteriaSequenceId,
SearchId,
SearchMethod,
CritExpression,
SubstringStartPosition,
SubstringLength,
CritDescription
);
END;
Der Fehler tritt in der Zeile mit * *. Ich bin mir nicht ganz sicher, was diesen Fehler verursacht, kann mir jemand helfen?