--
-- Build_regexp_instr
--
set echo off
set sqlprompt ""
set trims on
set pagesize 0
set feedback off
set linesize 132
set verify off
--undefine table
--
--
--prompt These variables required:
--prompt >   String
--prompt >   Pattern
--prompt >   Start position
--prompt >   Occurence number
--prompt >   Return Option
--prompt >   Match_Parameter
--prompt
accept string prompt 'String (double quotes for a literal)       :'
accept patter prompt 'The Pattern       :'
accept start  prompt 'Start pos   (I)   :'
accept occur  prompt 'Occurrence no (I) :'
accept retur  prompt 'Return Option (0-from start, 1-from end) :'
accept match  prompt 'Match Param (eg: i or c) :'
accept from   prompt 'Tname or Dual:'
--
select ' ' from dual;
--
spool a.sql
select
'select regexp_instr('||'&string'||','''||'&patter'||''','||
'&start'||','||'&occur'||','||'&retur'||','''||'&match'||''') result from &from;'
from dual;
spool off
--
select ' ' from dual;
--
set sqlprompt "SQL>"
set trims on
set pagesize 999
set feedback on
set verify on
@a
set echo on
