Groups > Databases > Oracle for ASP.NET > Re: Global Tempory Table + Oracle 9i




Global Tempory Table + Oracle 9i

Global Tempory Table + Oracle 9i
Wed, 19 Mar 2008 16:46:31 +000
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;
Post Reply
Re: Global Tempory Table + Oracle 9i
Thu, 20 Mar 2008 10:13:18 +000
i m not sure with the ans. Plz correct me if i m wrong.

In u r program u applied delete statement . Generally we will create a temporary
table with the option on delete commit rows or on delete reserve preserve rows.

I don't no which option was specified by you. Plz check that.
Post Reply
about | contact