DBerrorString


Synopsis

DBerrorString inserts a marker into an input string at a specified position.

Input ports

statement string
error_offset int
process_error int

Parameters

None

Output ports

error_string string
valid_error int

Description

DBerrorString inserts a marker into an input string at a specified position and returns the resulting string. The marker is the string ----->>.

This module is useful for creating an output string showing where an error occurred in an invalid SQL statement. To do this, you must enter the invalid SQL statement and the error offset from the beginning of the statement into the statement and error_offset input ports, respectively. (The error offset is returned by the database server.) The value returned in the valid_error output port indicates when DBerrorString has finished processing; you can use this as a trigger to open a UIwindow in which error information, including the output string, is displayed. For an example, see The Toolkits Book.

Input ports

statement

A string; typically, an invalid SQL statement.

error_offset

The offset (in bytes) from the beginning of the string indicating where the marker will be inserted. Typically, this is the error offset returned by the database server to indicate the position within an invalid SQL statement where an error occurred.

process_error

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

Parameters

None

Output ports

error_string

A string that consists of the input statement with the marker inserted at the position indicated by error_offset.

valid_error

A return value that indicates the processing status of the string insert operation. A value of 1 indicates that the string insert is being processed; a value of 0 indicates that processing has completed.

File

v/db.v

See Also

•