Execute SQL statement as another user

Database
Enthusiast

Execute SQL statement as another user

Hi, 

 

There is as way that through a privilleged user such as DBC or SYSDBA to execute a SQL Statement as another user? Is using GRANT CONNECT THROUGH a viable option?

I want to build a Stored Procedure that will dispatch some dynamic SQL as another user, that differs from the one is running the SP.

1 REPLY 1
Highlighted
Teradata Employee

Re: Execute SQL statement as another user

Hi.

 

I'm not sure about what you're trying to do, but you can use the SQL SECURITY clause with one of its options (CREATOR/DEFINER/OWNER) to execute a SP with diferent privileges other than the user that executes it (INVOKER) has. 

 

HTH.

 

Cheers.

 

Carlos.