I get this error while trying to run the procedure from an excel macro. I tried recompiling the SP and it still throws the same error. Any idea on how to fix this.
You will need to REPLACE (or DROP / CREATE) to resolve this error. ALTER COMPILE can change certain attributes, but not Creator.
(The check for creator privileges is based on the internal ID, not the name.)
If DROP PROCEDURE followed by CREATE PROCEDURE doesn't work, then it's probably time to open an incident with Teradata support.
@RB Perhaps there is an issue that the text of the message is not precisely identifying. What does this query return?
with NumAccessRights as (
select a.DatabaseID, count(*) as rowCount from dbc.AccessRights a group by 1 ) select o.DatabaseName as OwnerName, p.TVMName as ProcedureName, p.CreatorName, x.rowCount as NumOwnerRights, p.CreateUID, c.DatabaseName as CreateUIDName, y.rowCount as NumCreatorRights from dbc.TVM p join dbc.DBase o on p.DatabaseID = o.DatabaseID left join dbc.DBase c on p.CreateUID = c.DatabaseID left join NumAccessRights x on p.DatabaseID = x.DatabaseID left join NumAccessRights y on p.CreateUID = y.DatabaseID where o.DatabaseName = 'SYSDBA' /* Note: supply the appropriate owner of the SP if not SYSDBA */ and p.TVMName = 'SP_abc' ;