Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: instr question
kimberly.shaffer_at_gmail.com wrote:
> Thank you Brian,
>
> When I sort of plug in my current field and current table just to see
> what results I get, I get the following error
>
> SELECT SUBSTR(so_act_arg,INSTR(so_act_arg),' ')+1,
> INSTR(so_act_arg,' ',1,2) - NSTR(so_act_arg),' ')-1)
> FROM appworx.so_object_cond
> WHERE so_act_arg LIKE '-m%';
>
> FROM keyword not found where expected. What am I doing wrong?
a tool that does SQL auto-formating (like TOAD) is usefull for this type of stuff.
Try:
SELECT SUBSTR (so_act_arg
, INSTR (so_act_arg, ' ') + 1 , INSTR (so_act_arg, ' ', 1, 2) - INSTR (so_act_arg, ' ') - 1 )