When building an ODBC driver, Microsoft’s ODBC Test can be used to test the driver. This existing tool can reduce development time by eliminating having to write your own ODBC application for testing. On this blog, we will focus on how to bind named parameters through ODBC Test. If you are looking to do more testing with the tool, please refer to Testing your SimbaEngine SDK ODBC Driver with ODBC Test
- Type the stored procedure, {call StoredProcedureName(?,?,?)}.
Note that this stored procedure does not have a procedure return value. For this example, we will bind 3 parameters to a stored procedure by the name of “StoredProcedureName”. The first parameter is an input parameter with a string value of “Value1”, and a parameter name “ParamName1”. The second parameter is an input/output parameter with a sting value of “Value2” and a parameter name “ParamName2”. The third parameter is an output parameter with a string value of “Value3”, and a parameter name of “ParamName3”
- Set the ParameterNumber to 1, InputOutput Type to SQL_PARAM_INPUT=1 (2.0) and the ParameterValuePtr to Value1. Since this is a string type, we will use the default for the rest of the fields. Click OK
- Set the ParameterNumber to 2, InputOutput Type to SQL_PARAM_INPUT_OUTPUT=1 (2.0), the ParameterValuePtr to Value2 and the BufferLength to 100. Since this is a string type, we will use the default for the rest of the fields. Click OK
- Set the ParameterNumber to 3, InputOutput Type to SQL_PARAM_OUTPUT=1 (2.0), the ParameterValuePtr to Value3 and the BufferLength to 100. Since this is a string type, we will use the default for the rest of the fields. Click OK
- Set the DescriptorHandle to Implicic IPD, RecNumber to 1, FieldIdentifier to SQL_DESC_NAME and the ValuePtr to ParamName1. Click OK
- Set the DescriptorHandle to Implicic IPD, RecNumber to 2, FieldIdentifier to SQL_DESC_NAME and the ValuePtr to ParamName2. Click OK
- Set the DescriptorHandle to Implicic IPD, RecNumber to 3, FieldIdentifier to SQL_DESC_NAME and the ValuePtr to ParamName3. Click OK
- Retrieve the results of the stored procedure by clicking Results > Get Data All
Results of the stored procedure will be displayed.