DB_INSERT and DBS_INSERT actions


Function
The action will insert one or more rows into the table.
Declaration
DB_INSERT handleIdent_Int, rowIdent, retCodeIdent_Int [ORAHINT hintIdent_Str]
 
DBS_INSERT dbObjIdent, rowIdent, retCodeIdent_Int [TRANS transHandle_Int] [ORAHINT hintIdent_Str]
 
or
 
DB_INSERT handleIdent_Int, structIdent, retCodeIdent_Int [ORAHINT hintIdent_Str]
 
DBS_INSERT dbObjIdent, structIdent, retCodeIdent_Int  [TRANS transHandle_Int] [ORAHINT hintIdent_Str]
Parameters
handleIdent_IntinIdentifier (handle) of Int type of the connection with a table (DB_CONNECT).
dbObjIdentinReference to an object of Database table.
rowIdentinOne structure row identifier (row to insert).
structIdentinIdentifier of a whole structure (rows to insert).
retCodeIdent_IntoutReturn value of Int type - action success.
transHandle_IntinIdentifier of the Connection to the database.
hintIdent_StrinExpression 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
Table must be opened with the access _DB_MODIFY. There must be the correct structure type of inserted row or structure. Values of all items of every inserted row must be valid.

The advantage of the action DBS_INSERT at work with a table is the possibility to leave out its closing and opening (shorter code).

For D2000 v5.00: an disadvantage of the action DBS_INSERT is in speed. Each DBS_INSERT call results in necessity to open and close the database in DBManager - it can be a time-consuming operation and it is a comparatively nonstandard method in term of databases.
The need to open and close the database may be avoided in the scope of transaction processing so that the command is followed by the parameter

TRANS
.


For D2000 v6.00 and higher: DBManager optimization (connection recycling, predefined connections) causes, that the action DBS_INSERT is executes as quick as the action DB_INSERT and as moreover there is saved a time required for execution of the action DB_CONNECT to open the database.


Related pages:

Napíšte komentár