Dave Greeko <davegreeko@xxxxxxxxx> writes: > I tried both and I am getting syntax error. > char *query="select codec_id,fs_name,pt from codec_defs where pt = ANY(string_to_array(?, ','))"; > OR > char *query="select codec_id,fs_name,pt from codec_defs where pt = ANY(?::text)"; > PGresult *res=PQprepare(conn,"codecs",query,1,NULL); Well, your first problem is that "?" is not the parameter symbol understood by libpq+backend. Try "$1". The other problem, at least for the second version of that, is that you want to be passing a text array not a single text value --- so it needs to look more like "where pt = ANY($1::text[])". regards, tom lane