Executing insert statements stored in a table without stored proc

General
Enthusiast

Executing insert statements stored in a table without stored proc

Hi all,

In teradata, I have a bunch of insert statements which I create and store  in my volatile table. I need  to execute these insert statements. Our office environment doesn't allow us to use any stored proc. Is there any alternative? Any help is highly appreciated. Thanks!

Regards,

San

5 REPLIES
Enthusiast

Re: Executing insert statements stored in a table without stored proc

you can use ....example:

insert into abc values(1)

;insert into def values('def')

;insert into hgi values('ddd',1);

Enthusiast

Re: Executing insert statements stored in a table without stored proc

But how do I form this string and execute it? Right now I have one insert statement  in one row like -

ID                sql_column

1                  insert into mytable select a,b from smalltable;

2                  insert into mytable select c,d from smalltable;

3                  insert into mytable select x,y from smalltable;

I want to be able to execute all of them.

Enthusiast

Re: Executing insert statements stored in a table without stored proc

Do you have an option to use Bteq and run it?

Enthusiast

Re: Executing insert statements stored in a table without stored proc

If you can make in the format suggested, you can execute in bteq or TD studio. If you use unix it is even easier, sed or vi editor ,use a little bit of excel programming :)

Enthusiast

Re: Executing insert statements stored in a table without stored proc

Yes, I have the option of bteq. But I do not understand how do i form that string from my table?