Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 30 Jul 2002 @ 11:12:19 GMT


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


Subj:   Re: Creating stored procedure
 
From:   Sanjaya Nagabhushan

Seems like you have got the syntax right. You could try doing it this way

a) Grant 'create procedure' rights to the database/user under which you intend to create the stored procedure

Logging to the DBC, issue a grant as below

grant create procedure on to ;

b) Ensure that the 'C' compiler is installed on the server where Teradata is

c) Table 'divas' should be created prior to the next step.

d) Have the create procedure .... end; statement in a text file & issue the 'compile' command from bteq after logging in to the database/user under which you want to create the stored procedure

.compile file = pro.spl

where pro.spl contains

CREATE PROCEDURE divaProc (IN num integer,
IN name char(10))
BEGIN
INSERT INTO divas (num,name)
VALUES (:num, :name);
END;

Once the stored procedure is created successfully, you could invoke it as

call divaproc(1'abc');

Sanjay



     
  <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