I have not been able to completely understand how SETs work. I want to create SETs from not-singlet results of SELECT statements and I want to do the oposite, from SETs to regular table-like outputs.
DROP TABLE IF EXISTS persMergeExcl_tmp;
CREATE TEMP TABLE IF NOT EXISTS persMergeExcl_tmp
( rejectedPinSet SET(INT NOT NULL),
acceptedPinSet SET(INT NOT NULL)
);
The following INSET works:
INSERT INTO persMergeExcl_tmp VALUES
(SET{10,11,12},
SET{20,21,22,23,24});
The following INSERT does not work but shows the idea I want to achieve. There is always going to be a low number of items (no more than 15) in the rejectedPinSet and acceptedPinSet SETs.
INSERT INTO persMergeExcl_tmp VALUES
(SET{(SELECT rowid FROM t1 WHERE rowid < 260)},
SET{(SELECT rowid FROM t2 WHERE rowid < 780)});
Latter on I want to achieve things like this:
SELECT acceptedPinSet FROM persMergeExcl_tmp WHERE rejectedPinSet has value nnn
------------------------------
Zambrano, Hugo
Informix DBA
Ottawa Police
Ottawa, ON
(613)236-1222, 5575
------------------------------
#Informix