Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 08 Oct 2009 @ 14:22:09 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Volatile table in procedure
 
From:   Rahul Shashidhar Phadnis

Anomy.Anom wrote:

  But if you really want to utilize volatile table within stored procedure, you must create an instance of the volatile table in same session, prior to compiling stored procedure. This will allow the INSERT to compile. The compile does syntax checking of CREATE (so may get warning that it already exists), but does not execute it.  


Hi,

The life of the VT should exist in the procedure. Not sure how would I create the VT before I create the procedure. This procedure is called from a click on an application.

Even the manual suggested that create VT,insert are possible from the procedure. Not very clear what you are trying to suggest.

-------------

TD manual suggests

Version - v2r6

CREATE VOLATILE TABLE

If you include a CREATE VOLATILE TABLE statement in a stored procedure, the volatile table is created in your login database. If an object with the same name already exists in that database, the result is a runtime exception.

DML statements within a stored procedure referencing the volatile table must either have the user's login database as the qualifier, or not have any qualifying database name.

Not able to insert in the volatile table that I create from within a procedure.

Procedure compilation is a success when I comment out the insert statement. But when there is an insert statement it says cannot access the table.

Any idea ?

     CREATE PROCEDURE abc
     (
     )
     BEGIN

        CREATE VOLATILE TABLE abc_vt
        (
          Id1 INTEGER,
          Id2 INTEGER,
        )
        ON COMMIT PRESERVE ROWS;

        /*INSERT INTO abc_vt
        VALUES(1,1 );*/

     END;

Thanks

Rahul



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023