RATE THIS ANSWER
+1
Click to Vote:
1
0
One suggestion too all of the new bees, take time and and take a good look and alakyze your code, other wise you will send your code these sites all the time.
Here is your right code. "BEGIN" inside the loop didn't have "END"
DECLARE
str VARCHAR(255);
BDGroupArea VARCHAR(255);
pos INTEGER;
BEGIN
BDGroupArea := '1,2,3';
IF (INSTR(BDGroupArea,'%,%') <> 0) THEN
WHILE(INSTR(BDGroupArea,'%,%') <> 0) LOOP
--BEGIN
BDGroupArea := BDGroupArea + ',';
pos := INSTR(BDGroupArea,',');
str := SUBSTR(BDGroupArea,1, pos - 1);
INSERT INTO BDTable
(BDGroupArea)
VALUES (str);
BDGroupArea := SUBSTR(BDGroupArea, pos + 1 ,LENGTH(BDGroupArea));
END LOOP;
ELSE
INSERT INTO BDTable
(BDGroupArea)
VALUES (BDGroupArea);
END IF;
END;
Last Answered:
Jul 18 2008 5:12 PM GMT by Fhashmat 
90 pts.