Home:ALL Converter>Create a stored procedure in Aurora serverless postgres using aws cli in windows 10

Create a stored procedure in Aurora serverless postgres using aws cli in windows 10

Ask Time:2022-03-08T17:08:33         Author:Amar Panigrahy

Json Formatter

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.

Author:Amar Panigrahy,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/71392470/create-a-stored-procedure-in-aurora-serverless-postgres-using-aws-cli-in-windows
yy