Page tree
Skip to end of metadata
Go to start of metadata

DB_UPDATE_BLOB and DBS_UPDATE_BLOB actions


Function
Writing of one record of LOB type into the table in the database.
LOB (Large OBject) can be:
  • BLOB (Binary LOB),
  • CLOB (Character LOB),
  • XMLType (CLOB for work with xml data in Oracle DB).

Declaration
DB_UPDATE_BLOB handleIdent_Int, lobColNameIdent_Str, lobFileNameIdent_Str, retCodeIdent_Int, idKeyIdent [ORAHINT hintIdent_Str]
 
 DB_UPDATE_BLOB handleIdent_Int, lobColNameIdent_Str, lobFileNameIdent_Str, retCodeIdent_Int WHERE strExpression_Str [ORAHINT hintIdent_Str]
 
DBS_UPDATE_BLOB dbObjIdent, lobColNameIdent_Str, lobFileNameIdent_Str, retCodeIdent_Int, idKeyIdent [TRANS transHandle_Int] [ORAHINT hintIdent_Str]
 
DBS_UPDATE_BLOB dbObjIdent, lobColNameIdent_Str, lobFileNameIdent_Str, retCodeIdent_Int WHERE strExpression_Str [TRANS transHandle_Int] [ORAHINT hintIdent_Str]

Parameters
handleIdent_Int in Identifier of Int type (handle) of the connection to a database (DB_CONNECT).
lobColNameIdent_Str in Name of LOB type column in the table.
lobFileNameIdent_Str in Name of a file, from where the read record of LOB type is to be read.
transHandle_Int

in

Identifier of the Connection to the database.
idKeyIdent in Identification key determining the row (if the key consists of several columns, idKeyIdent is a structure of the same type as the table - just values of key columns are to be taken into account).
strExpression_Str in Expression of String type, that defines the table row read.
dbObjIdent in Reference to an object of Database table.
retCodeIdent_Int

out

Return code of Int type - action success.
hintIdent_Str in Expression of String type that defines Oracle SQL hint. It is used as an instruction for the performance optimizer of SQL command. The value is used without the opening and terminating characters /*+ <orahint> */.
The example is mentioned here.

Return code
The value of the parameter transHandle_Int. See the table of error codes. It is possible to get extended error information.
Description
The action DB_UPDATE_BLOB allows to write one record of LOB type into a table in a database. The table is given by the identifier dbObject, that represents an object of Database table type. The 2nd and 4th declarations are concerned to DBS actions, which do not require the explicit actions to open and close the database (DB_CONNECT and DB_DISCONNECT). It is also possible to use the running transaction identifier transHanlde_Int gained by previous calling the action DB_TRANS_OPEN. The written record of LOB type is read from a file, which name is given by the identifier lobFileNameIdent_Str. Value of the identifier lobColNameIdent_Str defines a name of the column, which type is LOB and will be overwritten.

Row (or rows in dependence on the result set of corresponding rows), which will be overwritten, can be defined:

  1. Using the parameter idKeyIdent. An identification key must be defined in the configuration of an object of Database table type. Then a row, with a value matching the given identification key, will be found in the table.
  2. By a value of the expression strExpression_Str, that represents a clause WHERE for the SQL command SELECT executing a selection from the table.

The parameter retCodeIdent_Int returns the attribute _ERR_NO_ERROR - action success, or:

  1. _ERR_FILE_ERROR - an error occurred during operation with the file.
  2. Other default error codes.

Note
The action was tested for the file of 175 MB. If the file exceeds 32768 bytes, a temporary file will be created in the current file of D2000 DBManager. After it is written into LOB it will be deleted automatically.

Related pages:

Write a comment…