Plese help me to convert the code:
Here am passing a character '<' as Param4.

PROCEDURE NextPrevOptionTest(Param1 IN VARCHAR,Param2 IN VARCHAR,Param3 IN VARCHAR,Param4 IN VARCHAR,Param5 IN VARCHAR,valretrive OUT REF_CURSOR)
AS
cur_position INTEGER;
remainder1 VARCHAR(1000);
cur_string VARCHAR(1000);
delimiter_length NUMBER;
delimiter VARCHAR(20);
queryOne VARCHAR(1000);
queryTwo VARCHAR(1000);
query1 VARCHAR(1000);
parameter VARCHAR(1000);
remainder_length INTEGER;
query_length INTEGER;
countFind INTEGER;
exeDrop VARCHAR(200);
finalSelectQu VARCHAR(200);
BEGIN
delimiter:=',';
remainder1:=Param1;
parameter:=Param2;
remainder_length:=LENGTH(remainder1);
delimiter_length:=LENGTH(delimiter);
cur_position:=1;
query1:='';
WHILE (LENGTH(remainder1) > 0 AND cur_position > 0)
LOOP
cur_position:=INSTR(remainder1,delimiter);
IF cur_position = 0
THEN
cur_string:= remainder1;
ELSE
cur_string:= SUBSTR(remainder1,0,cur_position-1);
END IF;
IF query1 =''
THEN
query1:='SUM(CASE Batch_Name WHEN '''||cur_string||''' THEN '||Param2||' ELSE 0 END) AS '|| cur_string ;
ELSE
query1:=query1||',SUM(CASE Batch_Name WHEN '''|| cur_string ||''' THEN '||Param2||' ELSE 0 END) AS '|| cur_string ;
END IF ;
remainder1:=SUBSTR(remainder1,cur_position+1,remai nder_length );

END LOOP;


query1:='CREATE OR REPLACE VIEW Step45_Flap1 AS
SELECT time_stamp FROM ( SELECT time_stamp FROM(
SELECT time_stamp FROM (SELECT time_stamp' ||query1||' FROM '||Param5||' GROUP BY time_stamp) WHERE time_stamp '||Param4||' TO_DATE('''||Param3||''',''MM/DD/YYYY HH24:MIS'')))';

EXECUTE IMMEDIATE query1;
OPEN valretrive FOR SELECT * FROM Step45_Flap1;

END NextPrevOptionTest;

Thanks in Advance
Vivek