Calling a Packaged Procedure via .Net
Someone recently posted a question in the Postgres Forums about how to call a package in Advanced Server. He also had a question about how to call a packaged procedure in a specific schema.
Here is my reply to the question:
You can’t actually execute packages. You execute the procedures or functions in them. Here is some code to execute a procedure in a package. I am using public as the schema name. If you want to execute a procedure in a user’s schema, just replace public with the user’s name.
static void Main(string args)
EDBConnection conn =
"User Id=enterprisedb;" +
EDBCommand cmd = new EDBCommand();
cmd.Connection = conn;
int vEmpId = 7876;
String query = "public.emp_admin.fire_emp(:e_id)";
cmd.CommandText = query;
cmd.CommandType = CommandType.StoredProcedure;
EDBParameter prm = new EDBParameter(
cmd.Parameters.Value = vEmpId;
You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.