Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Stored Proc help
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 resultFROM DUAL; Any ideas? Thanks!
![]() |
![]() |