0

I developed a function plpgsql that takes in an xml argument, parses the xmls and inserts into corresponding tables. It returns void after it finishes. I can co select functionname('xml string');

This will parse 'xml string' and insert into the destination table(s).

I want to invoke this using libpq.

const char *paramValues[1];
paramValues[0] = s.ptr;
char *stm = "select schema.LoadXML($1::xml)";
PGresult *res = PQexecParams(conn, stm, 1, NULL, paramValues, NULL, NULL, 0); 

I was unable to find any example show how to invoke a function taking parameters.

Thanks in advance.

kd

KartDev
  • 75
  • 2
  • 8
  • 0) what does the `res` contain after the call? 1) Does it work for simple text string? 2) check the posthres logfile – wildplasser Oct 20 '16 at 17:19
  • Hi @wildplasser. This works. I had another statement that I was looking for an incorrect result code which threw me off. – KartDev Oct 20 '16 at 17:47

0 Answers0