The following example demonstrates calling a stored procedure that includes IN parameters. To create the sample procedure, invoke EDB-PSQL and connect to the Advanced Server host database. Enter the following SPL code at the command line:When Advanced Server has validated the stored procedure it will echo CREATE PROCEDURE.Calling a stored procedure that contains parameters is very similar to executing a stored procedure without parameters. The major difference is that when calling a parameterized stored procedure you must use the EDBParameter collection of the EDBCommand object. When the EDBParameter is added to the EDBCommand collection, properties such as ParameterName, DbType, Direction, Size, and Value are set.The following example demonstrates the process of executing a parameterized stored procedure from a C#.In the example, the body of the Page_Load method declares and instantiates an EDBConnection object. The sample then creates an EDBCommand object with the properties needed to execute the stored procedure.The example then uses the Add method of the EDBCommand Parameter collection to add six input parameters.EDBCommand cmdStoredProc = new EDBCommand
cmdStoredProc.CommandType = CommandType.StoredProcedure;It assigns a value to each parameter before passing them to the EMP_INSERT stored procedureThe Prepare() method prepares the statement before calling the ExecuteNonQuery() method.The ExecuteNonQuery method of the EDBCommand object executes the stored procedure. After the stored procedure has executed, a test record is inserted into the emp table and the values inserted are displayed on the webpage.