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 -> Stored Proc help

Stored Proc help

From: CK <c_kettenbach_at_hotmail.com>
Date: Thu, 8 Nov 2007 11:13:19 -0800
Message-ID: <PeJYi.1156$sm1.351@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 Received on Thu Nov 08 2007 - 13:13:19 CST

Original text of this message

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