Procedures

Creating

Create procedure<procedure name>(<PARAMS>)As. BEGIN<SQL Queries>END;  

Replacing

Replace procedure<procedure name>(<PARAMS>)As. BEGIN<SQL Queries>END;  

Dropping

DROP procedure<procedure name>  

View

SHOW Procedure<procedure name>

Inclined to build a profession as Teradata Developer? Then here is the blog post on, explore Teradata Training

Calling

Call procedure<procedure name>(<PARAMS>)  

Example:

Create procedure (Dcone1 INTEGER,DName1 varchar(30))

BEGIN

DECLARE DEPTNAME VARCHAR(30);

SET DEPTNAME=DNAME1;

INSERT INTO DEPT(DCODE, DNAME)Values(:Dcode1,:DEPT NAME);

END;

Call p – sample(70,‘IT’);

Select* From Dept;

Teradata Interview Questions

Example:

Create procedure SP(PID INTEGER, out op INTEGER)

BEGIN

DECLARE VAR1 INTEGER;

SELECT Party income into:var1 from party where party =pid;

Select op=var1*10;

END;

Call SP(1, OP)

For Indepth knowledge on Teradata click on: