DBERROR


8.0.4, PLBCMP GUI or PLBLinux Only

 

The DBERROR instruction obtains error information from the database server. The instruction uses the following format:

 

 

[label]

DBERROR

{db};{errmsg},{sqlstate}:

 

 

 

{null},{code1},{code2}

 

Where:

label

Optional. A Program Execution Label.

db

Required. A DBFILE or DBSTATEMENT variable defining the database associated with the connection.

errmsg

Required. A Character String Variable that receives the actual error message from the database server.

sqlstate

Required. A Character String Variable that receives the status from the remote database server.

null

Required. A string Character String Variable that is always set to null.

code1

Required. A Numeric Variable that receives the native error value from the database server.

code2

Required. A Numeric Variable that is always set to zero.

Flags Affected: EOS, LESS

Note the following:

  1. This instruction requires a valid database connection. If no connection exists, a D205 error message will occur. Therefore, it can be misleading if this instruction is specified before a successful DBCONNECT.

  2. The LESS flag is set if no error information is available.

  3. The EOS flag is set if there is not enough room in the {errmsg} variable to receive the entire error field.

  4. Under Linux, the {sqlstate} variable is always set to null.

 

 

See Also: Example Code, SQL Instructions

 



PL/B Language Reference DBDISCONNECT DBEXECUTE