Sunday
Feb192012

SquidIncrementData

  • Increments a counter at a specified column and index.
  • Returns the new number.

Prototype

int SquidIncrementColumn(int iSquid, char* sParam, int iIndex, int iIncrement);

  • Parameters
iSquidSquid Connection Handle
sParamString containing the name of the column
iIndexRow index of the row to increment (1-based)
iIncrementAmount to adjust the current value by (can be negative)
  • Return Values
intNewly incremented number
-1Error occurred, call SquidGetLastError for details

Example

int iSquid;
lr_load_dll("SQUID-REST.dll");
iSquid = SquidConnect("http://localhost:8000");
SquidCreateColumn(iSquid, "NewColumn");
SquidSendData(iSquid, "NewColumn", "20");
SquidSendData(iSquid, "NewColumn", "100");
SquidSendData(iSquid, "NewColumn", "50");
SquidIncrementColumn(iSquid, "NewColumn", 1, -5);
SquidDisconnect(iSquid);