I am trying to create stored procedure in Aurora serverless postgres db.
I tried using the below command from windows cmd:
aws rds-data execute-statement --resource-arn "arn:aws:rds:eu-west-1:xxxx:cluster:democluster" --database "demo" --secret-arn "arn:aws:secretsmanager:eu-west-1:xxxx:secret:rds-db-credentials/cluster-U5TWNYQ2UGIBDE64D3ENAxxxx/postgres-xxxx" --sql && type storedProc.sql
Below is the stroredProc.sql:
CREATE PROCEDURE simpleproc (OUT param1 INT)
BEGIN
SELECT COUNT(*) INTO param1 FROM myrecords;
END
Error:
aws.cmd: error: argument --sql-statements: expected one argument
Some time I get issue saying procedure keyword does not exist.
I found this url in stackoverflow but its for Linux.
How to add a Stored Procedure to AWS RDS Aurora-Serverless?
But any help for windows based aws cli solution will be appreciated.