Any specific reason why you need procedure or Trigger for this?.
Use REGEXP_SUBSTR with CONNECT BY in a single SQL. You may include the query in your procedure to perform insert by passing the string argument.
'RC(.+?)ZQ' - match anything between RC and next ZQ
'ZQ(.+?)(RC|$)' - match anything between ZQ and next RC or line end
SQL Fiddle
Oracle 11g R2 Schema Setup:
create table t as
select 'RC1500ZQ10RC2400ZQ20RC23ZQ3RC2322ZQ22' as s from dual;
Query 1:
--INSERT INTO yourtarget(rc,zq)
SELECT REGEXP_SUBSTR(s, 'RC(.+?)ZQ', 1, LEVEL, NULL, 1) AS RC,
REGEXP_SUBSTR(s, 'ZQ(.+?)(RC|$)', 1, LEVEL, NULL, 1) AS ZQ
FROM t --or DUAL
CONNECT BY LEVEL <= REGEXP_COUNT(s, 'RC(.+?)ZQ')
Results:
| RC | ZQ |
|------|----|
| 1500 | 10 |
| 2400 | 20 |
| 23 | 3 |
| 2322 | 22 |