Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Need a way to split a varchar

Need a way to split a varchar

From: <jimi_xyz_at_hotmail.com>
Date: 19 Jul 2005 09:54:18 -0700
Message-ID: <1121792058.545080.110120@g43g2000cwa.googlegroups.com>


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;

END; Thanks,
Jimmie Received on Tue Jul 19 2005 - 11:54:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US