Ad
Procedure To Get The Parameters And Result Type Of A PostgreSQL Stored Procedure?
What is the procedure to get the parameter and return types of a stored procedure? (Google is of no help :-( ).
Something along the lines of:
using (var conn = new Npgsql.NpgsqlConnection(connectionString: c))
{
conn.Open();
using (var cmd = con.CreateCommand())
{
cmd.CommandText = "\"GetAllDx\"";
cmd.CommandType = CommandType.StoredProcedure;
cmd.GETPARAMETERS()????????
}
}
PostgreSQL 9.5
Npgsql 3.0.5
Ad
Answer
Here is one way:
SELECT pg_get_function_result(oid), pg_get_function_arguments(oid)
FROM pg_proc
WHERE proname = 'GetAllDx'
You may also find this useful (although this query returns more than you've asked for):
SELECT oid::regprocedure FROM pg_proc WHERE proname = 'GetAllDx'
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → I can't do a foreign key, constraint error
- → Setting a default value on settings form return null in Octobercms
- → Eloquent Multitable query
- → "Laravel 5.1" add user and project with userId
- → Image does not go in database with file name only tmp name saved?
- → Database backup with custom code in laravel 5 and get the data upto 10 rows from per table in database
- → Trait 'IlluminateFoundationBusDispatchesJobs' not found
- → Setting the maxlength of text in an element that is displayed
- → laravel check between 2 integer from database
- → how to retrieve image from database in laravel 5.1?
- → relationship for database Column type object
- → Carousel in Laravel 4 does not show as expected
Ad