GdaQueryFieldValue

## GdaQueryFieldValue GdaQueryFieldValue — Represents a single value (or a parameter) |

## Synopsis

                GdaQueryFieldValue;
    GObject*    gda_query_field_value_new       (GdaQuery *query,
                                                 GdaValueType type);
    void        gda_query_field_value_set_value (GdaQueryFieldValue *field,
                                                 const GdaValue *val);
    const GdaValue* gda_query_field_value_get_value
                                                (GdaQueryFieldValue *field);
    void        gda_query_field_value_set_default_value
                                                (GdaQueryFieldValue *field,
                                                 const GdaValue *default_val);
    const GdaValue* gda_query_field_value_get_default_value
                                                (GdaQueryFieldValue *field);
    GdaValueType gda_query_field_value_get_value_type
                                                (GdaQueryFieldValue *field);
    void        gda_query_field_value_set_is_parameter
                                                (GdaQueryFieldValue *field,
                                                 gboolean is_param);
    gboolean    gda_query_field_value_is_parameter
                                                (GdaQueryFieldValue *field);
    void        gda_query_field_value_set_not_null
                                                (GdaQueryFieldValue *field,
                                                 gboolean not_null);
    gboolean    gda_query_field_value_get_not_null
                                                (GdaQueryFieldValue *field);
    gboolean    gda_query_field_value_is_value_null
                                                (GdaQueryFieldValue *field,
                                                 GdaParameterList *context);
    gboolean    gda_query_field_value_restrict  (GdaQueryFieldValue *field,
                                                 GdaDataModel *model,
                                                 gint col,
                                                 GError **error);
    void        gda_query_field_value_set_dict_type
                                                (GdaQueryFieldValue *field,
                                                 GdaDictType *type);
    GdaDictType* gda_query_field_value_get_dict_type
                                                (GdaQueryFieldValue *field);

## Object Hierarchy

      GObject
       +----GdaObject
             +----GdaQueryObject
                   +----GdaQueryField
                         +----GdaQueryFieldValue

## Implemented Interfaces

GdaQueryFieldValue implements GdaXmlStorage, GdaReferer, GdaEntityField and GdaRenderer.

## Properties

      "gda-type"             gint                  : Read / Write
      "handler-plugin"       gchararray            : Read / Write
      "query"                gpointer              : Read / Write / Construct Only
      "restrict-column"      gint                  : Read / Write
      "restrict-model"       gpointer              : Read / Write

## Description

The value held in this object can be of any type (a GdaDictType object must be provided when creating the object). If the value can be considered as a parameter, then the possible values for this parameter can be limited by the result of the execution of a sub query (use the "value_provider*" properties to tell from which query field the values will be taken).

## Details

### GdaQueryFieldValue

    typedef struct _GdaQueryFieldValue GdaQueryFieldValue;

### gda_query_field_value_new ()

    GObject*    gda_query_field_value_new       (GdaQuery *query,
                                                 GdaValueType type);

Creates a new GdaQueryFieldValue object which represents a value or a parameter.

`query` : | a GdaQuery in which the new object will be
`type` : | the GDA type for the value
Returns : | the new object

### gda_query_field_value_set_value ()

    void        gda_query_field_value_set_value (GdaQueryFieldValue *field,
                                                 const GdaValue *val);

Sets the value of `field`, or removes it (if `val` is `NULL`)

`field` : | a GdaQueryFieldValue object
`val` : | the value to be set, or `NULL`

### gda_query_field_value_get_value ()

    const GdaValue* gda_query_field_value_get_value
                                                (GdaQueryFieldValue *field);

Get the value stored by `field`. If there is no value, but a default value exists, then the default value is returned.n it's up to the caller to test if there is a default value for `field`. The default value can be of a different type than the one expected by `field`.

`field` : | a GdaQueryFieldValue object
Returns : | the value or NULL

### gda_query_field_value_set_default_value ()

    void        gda_query_field_value_set_default_value
                                                (GdaQueryFieldValue *field,
                                                 const GdaValue *default_val);

Sets the default value of `field`, or removes it (if `default_val` is `NULL`)

`field` : | a GdaQueryFieldValue object
`default_val` : | the default value to be set, or `NULL`

### gda_query_field_value_get_default_value ()

    const GdaValue* gda_query_field_value_get_default_value
                                                (GdaQueryFieldValue *field);

Get the default value stored by `field`.

`field` : | a GdaQueryFieldValue object
Returns : | the value or NULL

### gda_query_field_value_get_value_type ()

    GdaValueType gda_query_field_value_get_value_type
                                                (GdaQueryFieldValue *field);

Get the GDA type of value stored within `field`

`field` : | a GdaQueryFieldValue object
Returns : | the type

### gda_query_field_value_set_is_parameter ()

    void        gda_query_field_value_set_is_parameter
                                                (GdaQueryFieldValue *field,
                                                 gboolean is_param);

Sets wether `field` can be considered as a parameter

`field` : | a GdaQueryFieldValue object
`is_param` : |

### gda_query_field_value_is_parameter ()

    gboolean    gda_query_field_value_is_parameter
                                                (GdaQueryFieldValue *field);

Tells if `field` can be considered as a parameter

`field` : | a GdaQueryFieldValue object
Returns : | TRUE if `field` can be considered as a parameter

### gda_query_field_value_set_not_null ()

    void        gda_query_field_value_set_not_null
                                                (GdaQueryFieldValue *field,
                                                 gboolean not_null);

Sets if a NULL value is acceptable for `field`. If `not_null` is TRUE, then `field` can't have a NULL value.

`field` : | a GdaQueryFieldValue object
`not_null` : |

### gda_query_field_value_get_not_null ()

    gboolean    gda_query_field_value_get_not_null
                                                (GdaQueryFieldValue *field);

Tells if `field` can receive a NULL value.

`field` : | a GdaQueryFieldValue object
Returns : | TRUE if `field` can't have a NULL value

### gda_query_field_value_is_value_null ()

    gboolean    gda_query_field_value_is_value_null
                                                (GdaQueryFieldValue *field,
                                                 GdaParameterList *context);

Tells if `field` represents a NULL value.

`field` : | a GdaQueryFieldValue object
`context` : | a GdaParameterList object
Returns : |

### gda_query_field_value_restrict ()

    gboolean    gda_query_field_value_restrict  (GdaQueryFieldValue *field,
                                                 GdaDataModel *model,
                                                 gint col,
                                                 GError **error);

Restricts the possible values which `field` can have among the calues stored in `model` at column `col`.

`field` : | a GdaQueryFieldValue object
`model` : | a GdaDataModel object
`col` : | a valid column in `model`
`error` : | a place to store errors, or `NULL`
Returns : | TRUE if no error occured

### gda_query_field_value_set_dict_type ()

    void        gda_query_field_value_set_dict_type
                                                (GdaQueryFieldValue *field,
                                                 GdaDictType *type);

Set the GdaDictType type of `field`

`field` : | a GdaQueryFieldValue object
`type` : | a GdaDictType object, or `NULL`

### gda_query_field_value_get_dict_type ()

    GdaDictType* gda_query_field_value_get_dict_type
                                                (GdaQueryFieldValue *field);

Get the GdaDictType type of `field`

`field` : | a GdaQueryFieldValue object
Returns : | the GdaDictType type

## Properties

### The "`gda-type`" property

      "gda-type"             gint                  : Read / Write

Allowed values: [0,24]

Default value: 24

### The "`handler-plugin`" property

      "handler-plugin"       gchararray            : Read / Write

Default value: NULL

### The "`query`" property

      "query"                gpointer              : Read / Write / Construct Only

### The "`restrict-column`" property

      "restrict-column"      gint                  : Read / Write

Allowed values: >= 0

Default value: 0

### The "`restrict-model`" property

      "restrict-model"       gpointer              : Read / Write