gda_command_create_parameter

Name

gda_command_create_parameter -- 

Synopsis

void gda_command_create_parameter (Gda_Command* cmd, gchar* name, GDA_ParameterDirection inout, GDA_Value* value);

Arguments

cmd

the command object

name

the name of the parameter

inout

direction of the parameter

value

value of the parameter

Description

This function creates a new parameter for the command. This is important if you want to use parameterized statements like "select * from table where key = ?" and substitute the value for key at a later time. It also comes handy if you don't want to convert each parameter to it's string representation (floating point values).

The inout parameter defines if the value parameter is used to pass a value to the statement or to receive a value. In the exampel abov the input parameter will have a value of #PARAM_IN. The value #PARAM_OUT is used for output parameters when the command executes a precoedure.

value points to a GDA_Value variable (there will be helper functions to create such varbales from the basic C types). This variable must hold a valid value when the gda_command_execute() function is called and the inout parameter is either #PARAM_IN or #PARAM_INOUT. If the inoput parameter is #PARAM_OUT, memory is allocated by the library and the user must free it using CORBA_free().

IMPORTANT

use the CORBA functions to allocate the memory for the value parameter if it's not a simple data type (integer, float, ...)