Calling Oracle Stored procedures using Powershell
May 15, 2012
I’ve been doing some Powershell work lately, and needed to call an Oracle stored procedure with input and output arguments. I didn’t see a good example that mimicked what I was doing, so once I figured it out, I figured it was a good idea to share it. Stored Procedure First, I created a simple stored procedure with both an input and output parameter. Powershell script Then I created a Powershell script to call the stored proc. Overall, the logic of the script is pretty straightforward. Create an Oracle connection and an Oracle Command Set the Command type to be Stored Procedure Add an input parameter, and set its type and value Add an output parameter, and set its type Open the connection Execute the stored procedure Close the connection Read the value of the output parameter Output I…