i'm trying to insert from C function some json data.
i'm using SPI_execute_plan function to do this.
json data prepared with StringInfo
simple example:
StringInfo Message = makeStringInfo();
appendStringInfoString(Message, "{\"Command\":227,\"Status\":2,\"JobId\":4"});
Datum Values[2];
Values[0] = Int32GetDatum(227);
Values[1] = CStringGetDatum(Message->data);
ret = SPI_execute_plan(PreparedTr, Values, NULL, false, 0);
if (ret > 0 && SPI_tuptable != NULL && SPI_processed){
///// Data inserted
}
"Command":227,"Status":2,"JobId":4}
first { simboll is lost....
Arsen
--
Арсен Арутюнян