DBupdate

Synopsis

DBupdate updates rows in a table in the current database with new values.

Input Ports

dbvisual_connect_descriptor ptr to a structure

statement string

process_statement int

Parameters

message string

connect_information DBconnectInformation group

dbvisual_descriptor ptr to a structure

db_specific_error_message string

db_specific_error_code int

statement_error_offset int

processing int

return_code int

Output Ports

None

Description

DBupdate updates a row in a table in the current database with new values by executing a SQL UPDATE statement. It is possible to update all columns in the row or only a subset of the columns. The row to be updated and the data values to be inserted are specified in the predicate of the UPDATE statement.

DBupdate starts a transaction if one has not already been started. To terminate the transaction, use DBcommit or DBrollback.

Input

dbvisual_connect_descriptor

A pointer to the connection descriptor of the session in which DBquery is to execute. This is the output of the DBconnect module that initiated the session.
CAUTION: Do not modify this value. A fatal error will result.

statement

A SQL UPDATE statement. This statement must be a complete, literal, SQL statement that includes all required keywords and all necessary input data values. It must not end with a semicolon. The maximum length allowed is 32K bytes.
For more information, see .

process_statement

A trigger that initiates execution of the UPDATE statement. When this value changes to a value greater than 0, the statement is executed.

Parameters

message

A message that describes the status of the update.

connect_information

Information about the current connection:
the database driver
the server host
the server name
the database name
the user ID
the connect string
the status of the connection: connected (1) or disconnected (0)
This parameter is of type DBconnectInformation.

dbvisual_descriptor

For internal use only.
CAUTION: Do not modify this value. A fatal error will result.

db_specific_error_message

An error message returned by the database server when an error occurs during its processing of the update. For more information, see your database documentation.

db_specific_error_code

An error code associated with the error message returned by the database server when an error occurs during its processing of the update. A value of 0 indicates success; a nonzero value indicates failure. For more information, see your database documentation.

statement_error_offset

A returned value indicating the position in the UPDATE statement where an error occurred. This value is returned only if the database server returns an error message indicating that the UPDATE statement is invalid.
This information is useful for constructing an error message; see DBerrorString.

processing

A return value that indicates the processing status of the update. This value is set to 1 while the update is being processed and is cleared to 0 to indicate that the update has completed.

return_code

The status code associated with the message returned in the message parameter. A value of 0 indicates success; a nonzero value indicates failure.

Output Port

none.


Example

Not available.

File

v/db.v

See also related modules

DBconnectInformation