Hi,
I have created Global temp table and created stored procedure to instert comma
saperated value into that table. In put of procedure is string variable P and
passing from frontend Classic ASP page and value is e.g
P=3,34,64,67,456,35,36,754,2356,5435,2435,1002,245,763,789..............) and
everytime it changed depends on selection.
Issue is when i call this procedure, I cant see data inserted into temp table.
I am not getting data into table.
Can any one help with this?
Code:
CREATE GLOBAL TEMPORARY TABLE temp(
Val1 VARCHAR2(4000) NULL
ON COMMIT PRESERVE ROWS
PROCEDURE SP_Insert
(
p IN VARCHAR2
)
As
a VARCHAR2(4000);
b VARCHAR2(4000);
Comma_Position NUMBER;
BEGIN
DELETE FROM temp;
a := p || ',';
LOOP
Comma_Position := INSTR(a, ',');
EXIT WHEN (NVL(Comma_Position, 0)) = 0;
b := TRIM(SUBSTR(a, 1,Comma_Position-1));
INSERT INTO temp (Val1)
VALUES (TRIM(SUBSTR(b,2,LENGTH(b)-2)));
a := SUBSTR(a, Comma_Position+1);
END LOOP;
END;
|