CodeCharge Studio

Custom Update Property

Configure the process of updating data.

Applies to

Record, Editable Grid

Description

This property opens a dialog where you can specify the table, procedure or SQL statement to be used for updating data submitted via the form. This method can be used when the standard update functionality based on the form's data source is insufficient. For example you may not want to update all fields, or replace field values submitted by the form.

The main section of the Custom Update dialog contains parameters that construct the SQL query statement, variables used in custom SQL statement, or Stored Procedure parameters. To open the parameter configuration dialog click the plus button ([+]) or double click an existing parameter.

The following table parameter configuration values are available:

Field    
  Name The name of the data field to be updated.
  Type The type of the data field.
  Format The format of the data field.
Parameter    
  Name Designate a parameter whose value will be assigned to the data field.
  Type Select parameter type.
  Format Specify parameter format.
If parameter is empty   Parameter is considered empty when parameter source collection does not contain corresponding item. This may happen, for example, when the parameter is not submitted by the form or if the code expression it is based on returns a null value.
  Do not update field If parameter value is empty the corresponding field won't be included into the SQL UPDATE statement.
  Use value If parameter value is empty the specified value will be used during update.

 

Parameter configuration for SQL based custom update:

When configuring custom update property you may specify your own SQL UPDATE statement to be executed after the form is submitted. The SQL statement can include variables in curly braces, such as {variable_name}, which will be replaced at run-time by the corresponding parameter that you must configure with the same name as each  variable used in the SQL statement. For example if an  SQL statement is  UPDATE employees SET emp_name='{name}'  , then the corresponding name parameter must be created and configured.
To open the parameter configuration dialog click the plus button ([+]) or double click an  existing parameter.

The following SQL update parameter configuration values are available:

Field    
  Name The name of the data field to be updated.
  Type The type of the data field.
  Format The format of the data field.
Parameter    
  Name Designate a parameter whose value will be assigned to the data field.
  Type Select parameter type.
  Format Specify parameter format.
If parameter is empty   Parameter is considered empty when parameter source collection does not contain corresponding item. This may happen, for example, when the parameter is not submitted by the form or if the code expression it is based on returns a null value.
  Do not update field If parameter value is empty the corresponding field won't be included into the SQL UPDATE statement.
  Use value If parameter value is empty the specified value will be used during update.

 

Parameter configuration for Stored Procedure based custom update:

Parameter configuration options are similar to the above SQL parameters except for additional properties, such as Data Size, Direction, Scale and Precision. Those additional options corresponds to the stored procedure parameters within your database.

See Also

Custom Update Type property


On-line, printable versions and updates