db_result_t db_qinsert ( db_cursor_t  hcursor,
const db_bind_t binds,
db_len_t  nbinds,
db_object_t  uobject,
db_flags_t  flags 
)

Insert a new row into a cursor's table using a binding array.

db_qinsert is a convenience function that combines db_alloc_row and db_insert. For best performance in tight loops, use db_alloc_row outside the loop and db_insert inside the loop.

Postcondition:
The cursor is positioned on the inserted row.
Parameters:
hcursor Cursor handle.
binds Array of bindings.
nfields Number of fields in binds.
uobject Row data for relative bindings. Use NULL if hrow does not contain relative bindings.
flags 
  • DB_INSERT_SEEK_NEW - seek to the newly inserted record.
  • 0 - stay at the current record whatever it is.
Returns:
On failure, one of the following error codes is set:
  • DB_EINVAL Caused by: invalid cursor, relative field binding is null.
  • DB_EBINDSIZE Invalid bind size
  • DB_ERANGE Argument is out of range. Number of fields < 0 or number of fields > binds.size.
  • DB_ENAME Invalid field name used in binding.
  • DB_ESTATE The cursor does not support insert operations.

See also:
get_db_error, clear_db_error, Error Handling


Copyright © 2005-2008 ITTIA®. All rights reserved.