BTEQ - Compile in Teradata

It defines a stored procedure object.
The SPL (Stored procedure language) file only can be supplied as input to the COMPILE command.
If no syntax errors were encountered, then the particular structure will be stored in the database.

In an open transaction, you can not render directly the CREATE and REPLACE procedure commands, only the SPL file is allowed for the operation.

Example:

Usage:

.SET SESSION TRANS BTET
.LOGON server/user, password
BT; 
SELECT date;
.COMPILE FILE spSample1
ET;


In a Non transaction mode, COMMIT must be supplied.
SET SESSION TRANS ANSI;
LOGON server/user, password;
SELECT date;
.COMPILE FILE spSample1;
COMMIT;


Wrong usage (Compile must be the last statement in a transaction)
SET SESSION TRANS BTET;
LOGON server/user, password;
BT; 
COMPILE FILE spSample1;
SELECT date;
ET;