Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Stored Proc help

Re: Stored Proc help

From: CK <c_kettenbach_at_hotmail.com>
Date: Thu, 8 Nov 2007 13:25:34 -0800
Message-ID: <OaLYi.1230$0Q5.762@nlpi070.nbdc.sbc.com>


Got it all fixed up. Thanks!!!!

"shakespeare" <whatsin_at_xs4all.nl> wrote in message news:47336458$0$233$e4fe514c_at_news.xs4all.nl...
>
> "CK" <c_kettenbach_at_hotmail.com> schreef in bericht
> news:PeJYi.1156$sm1.351_at_nlpi068.nbdc.sbc.com...
>> This is failing. I got the sql to work but when i put it in a proc I am
>> having a little trouble. Any ideas?
>>
>> CREATE OR REPLACE PROCEDURE searchThis
>> (m_stringToSearch varchar, m_search char, result out integer)
>> AS
>> BEGIN
>> DECLARE position integer :=1;
>> WHILE position <= length(m_stringToSearch)
>> LOOP
>> SELECT INSTR(m_stringToSearch, m_search, position, 1) INTO result FROM
>> DUAL;
>> dbms_output.put_line(result);
>> IF result > 0 THEN
>> position := result + 1;
>> ELSE
>> position := length(m_stringToSearch) + 1;
>> END IF;
>> END LOOP;
>> END;
>>
>> I get
>> ERROR at line 8: PLS-00103: Encountered the symbol "=" when expecting one
>> of the following:
>>
>> := . ( @ % ; not null range default character
>> 6. BEGIN
>> 7. DECLARE position integer :=1;
>> 8. WHILE position <= length(m_stringToSearch)
>> 9. LOOP
>> 10. SELECT INSTR(m_stringToSearch, m_search, position, 1) INTO result
>> FROM DUAL;
>>
>> Any ideas? Thanks!
>> ~ck
>>
>
> Should be
> CREATE OR REPLACE PROCEDURE searchThis
> (m_stringToSearch varchar, m_search char, result out integer)
> AS
> position integer :=1;
> BEGIN
> ...
>
> Shakespeare
>
Received on Thu Nov 08 2007 - 15:25:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US