set_value_at


Description:

[ CCode ( cname = "gda_server_operation_set_value_at_path" ) ]
[ Version ( since = "4.2.6" ) ]
public bool set_value_at (string? value, string path) throws Error

Set the value for the node at the path formed using path_format and the ... ellipse (the rules are the same as for to_string).

Note that trying to set a value for a path which is not used by the current provider, such as "/TABLE_OPTIONS_P/TABLE_ENGINE" for a PostgreSQL connection (this option is only supported for MySQL), will not generate any error; this allows one to give values to a superset of the parameters and thus use the same code for several providers.

Here are the possible formats of path_format:

  • If the path corresponds to a Holder, then the parameter is set to "@value"
  • If the path corresponds to a sequence item like for example "/SEQUENCE_NAME/5/NAME" for the "NAME" value of the 6th item of the "SEQUENCE_NAME" sequence then:
    • if the sequence already has 6 or more items, then the value is just set to the corresponding value in the 6th item of the sequence
    • if the sequence has less then 6 items, then items are added up to the 6th one before setting the value to the corresponding in the 6th item of the sequence
  • If the path corresponds to a DataModel, like for example "/ARRAY/@ COLUMN/5" for the value at the 6th row of the "COLUMN" column of the "ARRAY" data model, then:
    • if the data model already contains 6 or more rows, then the value is just set
    • if the data model has less than 6 rows, then rows are added up to the 6th one before setting the value

Parameters:

this

a ServerOperation object

value

a string

path

a complete path to a node (starting with "/")

Returns:

true if no error occurred