0

ScanCAS() & MapScanCAS() are returning the values of the database row(old), only if the insert statement is not applied on a database table.

insertQuery = "INSERT INTO my_table (id, column1, column2) " + "VALUES (?, ?, toTimeStamp(now())) IF NOT EXISTS"

applied, err := session.Query(insertQuery,ID,column1).ScanCAS(&id,
        &value1,
        &value2)

How to bind the values of table row, upon successful insert? because ScanCAS binds the values(previous) only with failed attempt of insert query....

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
overexchange
  • 15,768
  • 30
  • 152
  • 347

0 Answers0