create or replace procedure ADD_LINE_NAME(
Para0 varchar2, ---line_Name
noExists OUT CHAR
)
is
/******************************************************************************
NAME: ADD_LINE_NAME
PURPOSE: ADD line NAME into table line_Name
REVISIONS:
Ver Date Author Description
--------- ---------- --------------- ------------------------------------
1.0 2006-8-22 ZHIHUA 1. Created this procedure.
******************************************************************************/
temp varchar2(20) := null;
CURSOR tempCursor
IS
SELECT line_Name FROM LINE_NAME
WHERE line_Name = Para0;
BEGIN
OPEN tempCursor;
fetch tempCursor into temp;
IF tempCursor%NOTFOUND THEN --If not exists
noExists := 'T';
INSERT INTO LINE_NAME VALUES(Para0);
COMMIT;
ELSIF tempCursor%FOUND THEN --If exists
noExists := 'F';
END IF;
CLOSE tempCursor;
end ADD_LINE_NAME;