I have the input
var1,var2,var3
and I need to insert or update into 3 row table with split by ",", How do I do that, thank you
I have the input
var1,var2,var3
and I need to insert or update into 3 row table with split by ",", How do I do that, thank you
If i understood your question correctly you want to create three rows out of one input text line broken down by some delimitter. You can do this with Regex_substr
CREATE TABLE TEST AS (
SELECT REGEXP_SUBSTR ('var1,var2,var3','[^,]+',1 ,LEVEL) values
FROM DUAL
CONNECT BY REGEXP_SUBSTR ('var1,var2,var3','[^,]+' ,1 ,LEVEL) IS NOT NULL)
and just the insert as follow up:
INSERT INTO TEST (
SELECT REGEXP_SUBSTR ('var1,var2,var3', '[^,]+',1,LEVEL) VALUES
FROM DUAL
CONNECT BY REGEXP_SUBSTR ('var1,var2,var3','[^,]+' ,1 ,LEVEL) IS NOT NULL)
For the update you need to be more specific on what the operation (before -> after) shall accomplish