Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 15 Sep 2004 @ 22:40:26 GMT


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


Subj:   Re: Create Stored Procedure from inside a BTEQ Script
 
From:   Dennis Calkins

Hi,

Here is an example I put together for someone a while back where it is all embeeded inside a single BTEQ script.

It makes use of liberal calls to

     .os

which means go run this from the command line. Also it was written from UNIX. I guess you could do the same thing on windows provided the command were DOS-ized.

     .logon mytdp/myuser1,myuser1

     create user  myuser as perm = 1e6, password=myuser;
     grant create procedure on myuser to myuser with grant option;
     grant all on myuser to myuser with grant option;

     .logon myuser,myuser;

     .os  rm /tmp/my.spl
     .os  echo "CREATE PROCEDURE my_procedure (mystring VARCHAR(300))"
     >> /tmp/my.spl.os  echo " BEGIN" >> /tmp/my.spl
     .os  echo "      CALL DBC.SysExecSQL(:mystring) ; " >> /tmp/my.spl
     .os  echo " END;" >> /tmp/my.spl


     .compile file = /tmp/my.spl

     call my_procedure('create database george as perm = 1e4');


     
  <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