Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual

2.3.30.20 NdbTransaction::insertTuple()

Description.  Inserts a tuple using NdbRecord.

Signature. 

const NdbOperation* insertTuple
    (
      const NdbRecord* key_rec,
      const char* key_row,
      const NdbRecord* attr_rec,
      const char* attr_row,
      const unsigned char* mask = 0,
      const NdbOperation::OperationOptions* opts = 0,
      Uint32 sizeOfOptions = 0
    )

const NdbOperation* insertTuple
    (
      const NdbRecord* combined_rec,
      const char* combined_row,
      const unsigned char* mask = 0,
      const NdbOperation::OperationOptions* opts = 0,
      Uint32 sizeOfOptions = 0
    )

Parameters.  insertTuple() takes the following parameters:

  • A pointer to an NdbRecord indicating the record (key_rec) to be inserted.

  • A row (key_row) of data to be inserted.

  • A pointer to an NdbRecord indicating an attribute (attr_rec) to be inserted.

  • A row (attr_row) of data to be inserted as the attribute.

  • A mask which can be used to filter the columns to be inserted.

  • OperationOptions (opts) can be used to provide more finely-grained control of operation definitions. An OperationOptions structure is passed with flags indicating which operation definition options are present. Not all operation types support all operation options; for the options supported by each type of operation, see Section 2.3.30.21, “NdbTransaction::readTuple()”.

  • The optional sizeOfOptions parameter is used to preserve backward compatibility of this interface with previous definitions of the OperationOptions structure. If an unusual size is detected by the interface implementation, it can use this to determine how to interpret the passed OperationOptions structure. To enable this functionality, the caller should pass sizeof(NdbOperation::OperationOptions) for the value of this argument.

This method can also be called using a single NdbRecord pointer and single char pointer (combined_rec, combined_row) where the single NdbRecord represents record and attribute and data.

Return value.  A const pointer to the NdbOperation representing this insert operation.


User Comments
Sign Up Login You must be logged in to post a comment.