Archives of the TeradataForum
Message Posted: Sat, 23 Nov 2002 @ 18:39:41 GMT
Subj: | | Re: Syntax error in Stored Procedure |
|
From: | | Syed Arifuddin |
Hi,
I am using the following code which is again giving me the run time problem.
replace procedure arif.listtables()
begin
declare rowcount int;
declare tablenames varchar(100);
for row_cursor as row_cursor1 cursor for
select TableName from dbc.tables where TableKind='T' and
databasename='arifdb' and tablename='dept'
DO
set tablenames = row_cursor.Tablename;
CALL DBC.SysExecSQL('insert into arifdb.tableinfo SELECT '''||
:row_cursor.Tablename||''', COUNT(*) from '||:row_cursor.Tablename);
END FOR;
end;
5568:listtables: 5568 SQL statement is not supported within a stored procedure.
Can you please suggest something.
Thanks.
Syed.
|