Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Teradata query doubt important - response (5) by terdeveloper2012

$
0
0
Hi Dieter, thank you very much...it seems to run..just a question...I have also tried to use a loop creating the procedure :   replace procedure GetQuery ( OUT xToken varchar(2000)) begin declare sqlQuery varchar(2000); declare sqlQueryNew varchar(2000); declare n integer; set n = 0; set sqlQuery = 'select * from (select 0 as x) dt'; while n <400 do set n = n + 1; set sqlQuery = sqlQuery || ' union ' || 'select * from (select' || n || ' as x) dt'; end while; select :sqlQuery into :xToken ; end;   This procedure compose the query ''select * from (select 0 as x) dt union select * from (select 1 as x) dt...........................select * from (select 400 as x) dt"   but how can I execute it? I 've tried with EXECUTE IMMEDIATE (:sqlQuery) and CALL DBC.SYSEXECSQL(:sqlQuery) but it doesn't work

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>