My code is like this:
SELECT COL_NAME, COUNT BULK COLLECT INTO v_collections FROM
(
SELECT 'PROD_NAME' COL_NAME, COUNT(*) COUNT FROM TEST_TABLE
WHERE LENGTH(PROD_NAME)>50
UNION ALL
SELECT 'PROD_DESC' COL_NAME, COUNT(*) COUNT FROM TEST_TABLE
WHERE PROD_DESC IS NULL
.
.
.
..10 MORE UNION ALL
);
{code}
--does it lead to one context switch or multiple one for each select in the union all
--I do want to capture # of errors for each column
--although the code runs very fast, still I am worried that it may not be a good coding practice.
--is there any better way to do this?
--TEST_TABLE has 1 million records
Thanks,
RN