79114471

Date: 2024-10-22 14:17:15
Score: 0.5
Natty:
Report link

I found one way to do this, but I suspect there's a better way.

EXECUTE IMMEDIATE $$
DECLARE
  stmt STRING;
BEGIN
  stmt := CONCAT('GRANT ROLE X TO USER ', CURRENT_USER(), ';');
  EXECUTE IMMEDIATE stmt;
END;
$$
;
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: Patrick Finnigan