Ganesh Pitchai
Ganesh Pitchai

Reputation: 55

Unable to create a Stored procedure in Redshift Aginity and aginity pro

Trying to create the stored procedure in redshift aginity workbench but it through an error like 'unterminated dollar-quoted string at or near "$$ '

In amazon, they already gave the solution for this https://docs.aws.amazon.com/redshift/latest/dg/stored-procedure-create.html

particular client tool only supported to create the stored procedure. I want to conform aginity don't have the option to create this? and Which is the best tool to create stored-procedure?

CREATE OR REPLACE PROCEDURE staging.test_sp1(f1 int, f2 varchar)
AS $$
BEGIN
  RAISE INFO 'f1 = %, f2 = %', f1, f2;
END;
$$ LANGUAGE plpgsql;

Upvotes: 2

Views: 1247

Answers (2)

Matthew Mullins
Matthew Mullins

Reputation: 71

You can create RedShift stored procedures in Aginity Pro by using Run Batch. Full support will be in the 9/16 release.

Upvotes: 2

Joe Harris
Joe Harris

Reputation: 14035

Aginity need to update their tool to pass the dollar quoted procedure body to Redshift correctly. I note that Aginity is able to execute the procedure with CALL staging.test_sp1().

Some other tools have already been updated to allow creation and you can always use psql to create the procedure.

Upvotes: 2

Related Questions