I have a food record:
pollo, carne, pez, res, zanahoria
What I would like is to use a cursor to separate each food and enter each one in a new record
pollo
carne
pez
res
zanahoria
I'm using Oracle 11g - temporary tables - PL/SQL and this is more or less the idea:
CURSOR MIC IS
SELECT UPPER(ALIMENTOS) FROM COMIDAS
BEGIN
FOR I IN MIC LOOP
There are multiple ways to do it. A relatively simple one is to use
CONNECT BY
andREGEXP_SUBSTR()
.CONNECT BY
allows you to recursively go through the chain, whileREGEXP_SUBSTR()
extracting the elements of it.