Re: An Oracle 10g Question
From: DA Morgan <damorgan_at_psoug.org>
Date: Sat, 26 Jan 2008 13:57:26 -0800
Message-ID: <1201384624.960167@bubbleator.drizzle.com>
>
>
> Is this the proper way to do this:
>
>
> DECLARE
> x NUMBER;
>
> BEGIN
> x := SELECT REGEXP_INSTR
> ('"null","null","null","GMO, DXDT, SDS, QID, MZZ","90", "3
> ASC"', '"[[:alnum:]]+, .*"',1) pos
> FROM DUAL;
> DBMS_OUTPUT.PUT_LINE('HERE: ' || x);
> END ;
> /
>
>
> Or do I need to use an INTO??
Date: Sat, 26 Jan 2008 13:57:26 -0800
Message-ID: <1201384624.960167@bubbleator.drizzle.com>
amerar_at_iwc.net wrote:
> On Jan 25, 9:46 pm, csn <csn..._at_gmail.com> wrote:
>> select >> regexp_instr('"null","null","null","GMO, DXDT, SDS, QID, >> MZZ","90", "3 ASC"', >> '"[[:alnum:]]+, .*"',1) pos from dual; >> >> This one looks for >> >> "XXXXXXX,_......." >> >> which is exactly your description, and returns a non-zero code of 22 >> which is the starting position in the string. >> >> Note: _ means space.
>
>
> Is this the proper way to do this:
>
>
> DECLARE
> x NUMBER;
>
> BEGIN
> x := SELECT REGEXP_INSTR
> ('"null","null","null","GMO, DXDT, SDS, QID, MZZ","90", "3
> ASC"', '"[[:alnum:]]+, .*"',1) pos
> FROM DUAL;
> DBMS_OUTPUT.PUT_LINE('HERE: ' || x);
> END ;
> /
>
>
> Or do I need to use an INTO??
In PL/SQL you must do an INTO
ALNUM = AlphaNumeric
Your ability to succeed in Oracle if basic syntax questions require you to ask for help is zero. Very quickly people will identify you as terminally lazy and stop helping.
The docs are at http://tahiti.oracle.com. Learn to use them. Then ask questions when the docs are unclear.
-- Daniel A. Morgan Oracle Ace Director & Instructor University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Sat Jan 26 2008 - 15:57:26 CST