ServerProvider.stringToValue

Use provider to create a new #GValue from a single string representation.

The preferred_type can optionally ask provider to return a #GValue of the requested type (but if such a value can't be created from string, then null is returned); pass #G_TYPE_INVALID if any returned type is acceptable.

The returned value is either a new #GValue or null in the following cases:

  • string cannot be converted to preferred_type type
  • the provider does not handle preferred_type
  • the provider could not make a #GValue from string

If dbms_type is not null, then if will contain a constant string representing the database type used for the conversion if the conversion was successfull, or null otherwise.

Parameters

cnc gda.connection.Connection

a #GdaConnection object, or null

string_ string

the SQL string to convert to a value

preferredType gobject.types.GType

a #GType, or #G_TYPE_INVALID

dbmsType string

place to get the actual database type used if the conversion succeeded, or null

Return Value

Type: gobject.value.Value

a new #GValue, or null