All Forums General
san28 20 posts Joined 01/14
30 Sep 2014
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

Raja_KT 1246 posts Joined 07/09
30 Sep 2014

you can use ....example:
insert into abc values(1)
;insert into def values('def')
;insert into hgi values('ddd',1);

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

san28 20 posts Joined 01/14
30 Sep 2014

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.
 

RanjaniKartik 9 posts Joined 09/14
30 Sep 2014

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

Raja_KT 1246 posts Joined 07/09
30 Sep 2014

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 :)

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

san28 20 posts Joined 01/14
01 Oct 2014

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

You must sign in to leave a comment.