2

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;

2 Answers2

2

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.

Joe Harris
  • 13,671
  • 4
  • 47
  • 54
  • 1
    Can you suggest which is the best one for Redshift? – Ganesh Pitchai Aug 06 '19 at 14:45
  • 1
    Aginity will probably have an update that supports this soon. You can also try these other tools: datarow.com , Falcon - plot.ly/free-sql-client-download , sqlectron.github.io , tableplus.com , jetbrains.com/datagrip . Pricing varies, some are free. – Joe Harris Aug 06 '19 at 17:46
2

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