I want to read a flat file to fetch a dynamic list of values (number of values is not fixed) & then I want to use this list of values in the IN clause of an select query in Pro *C. What is the best way to achieve this using Pro *C? I came across a few useful articles here & here but I just want to check if there is a more suited solution to my use case. It will be also useful to weigh the pros and cons of options that I might have.
Just to give an example, the following is the query:
SELECT ca.co_id
INTO :host_co_id_1
FROM contr1 ch1, contr2 ca
WHERE ch_seqno = (SELECT MAX (ch_seqno) FROM ontr1 ch2
WHERE ch1.co_id = ch2.co_id)
and ch1.ch_status IN ('a','s')
AND ca.co_id = ch1.co_id
AND ca.tmcode IN (14,16,36,37,38,39,40,41,42,79,60);
The number list:
14,16,36,37,38,39,40,41,42,79,60
is the dynamic list read from a file.