Archives of the TeradataForum
Message Posted: Wed, 13 Feb 2008 @ 10:36:06 GMT
As far a I am aware, "INTO" definitely DOES work.
Perhaps you need to make sure that you have a single-row query?
Here is a code snippet from a working stored procedure that I am using:
select top 1 DBTB into :mySQL from ( select * from ( select 1 rnk, 'drop table' ||trim(DatabaseName) ||'.' ||trim(TableName) DBTB from dbc.tables where DatabaseName = :WORKDB and TableName = :TB||'ERTBL' union all select 2 rnk, 'Table ' ||:WORKDB ||'.' ||:TB ||'ERTBL not found'DBTB from sys_calendar.CALENDAR where calendar_date = date ) V_1 QUALIFY (ROW_NUMBER() OVER(ORDER BY rnk ASC) > 0) ) V_2;
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|