Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Need a way to split a varchar
I am looking for a function, or some other way to split my variable
type varchar. The way i would like to do it is to , cut the first word
from the variable, place it in the database, along with the id of that
word. Then move to the next word. Im using PL?SQL. Here is what i have
so far...
DECLARE
auto_key NUMBER(11);
objective_clob_size NUMBER(10); objective_clob CLOB; objective_varchar2 VARCHAR2(1000);
BEGIN auto_key := 1;
SELECT objectives INTO objective_clob FROM project WHERE jobordernumber = 'DAML0001'; objective_clob_size := dbms_lob.getlength(objective_clob); dbms_lob.read(objective_clob, objective_clob_size, 1, objective_varchar2); objective_varchar2 := TRIM(objective_clob); INSERT INTO list(id, word) VALUES(auto_key, objective_varchar2); COMMIT;