Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual

2.3.24.16 NdbInterpretedCode::branch_col_ne()

Description.  This method compares a table column value with an arbitrary constant and jumps to the specified program label if the two values are not equal. In NDB 8.0.18 and later, it can also be used to compare a table column value with another table column value instead.

Signature.  Compare a table column value with a constant:

int branch_col_ne
    (
      const void* val,
      Uint32 len,
      Uint32 attrId,
      Uint32 Label
    )

Compare two table column values:

int branch_col_ne
    (
      Uint32 attrId1, 
      Uint32 attrId2, 
      Uint32 label
    )

Parameters.  When comparing a table column value with a constant, this method takes the four parameters listed here:

  • A constant value (val)

  • The length of the value (in bytes)

  • The attribute ID of the table column whose value is to be compared with val

  • A Label (previously defined using def_label()) to jump to if the compared values are unequal

When comparing two table column values, the parameters required are shown here:

  • AttrId1: The attribute ID of the first table column whose value is to be compared

  • AttrId2: The attribute ID of the second table column

  • label: Location to jump to if the compared columns are not the same. Must already have been defined using def_label()

When using this method to compare two table column values, the columns must be of exactly the same type.

Return value.  Returns 0 on success, -1 on failure.