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: Oracle Newbie Question

Re: Oracle Newbie Question

From: shakespeare <whatsin_at_xs4all.nl>
Date: Thu, 8 Nov 2007 20:39:07 +0100
Message-ID: <473365e0$0$238$e4fe514c@news.xs4all.nl>

"shakespeare" <whatsin_at_xs4all.nl> schreef in bericht news:47336566$0$229$e4fe514c_at_news.xs4all.nl...
>
> "CK" <c_kettenbach_at_hotmail.com> schreef in bericht
> news:oYHYi.4397$RR6.3038_at_newssvr22.news.prodigy.net...
>> ok I got it fixed, but what am I doing wrong in calling the procedure?
>>
>> Final proc:
>> CREATE OR REPLACE PROCEDURE searchThis2
>> (m_stringToSearch varchar, m_search char, result out integer)
>> AS
>> BEGIN
>>
>> SELECT INSTR(m_stringToSearch ,m_search , 1,1) INTO result FROM DUAL;
>>
>> END;
>> /
>>
>> I am trying to call it like this. I am using the Express 10g edition and
>> using the web sql commands tool provided with the install.
>>
>> BEGIN
>> searchThis2('Here is my search string', 'c');
>> END;
>>
>> I get the error:
>> ORA-06550: line 2, column 1:
>> PLS-00306: wrong number or types of arguments in call to 'SEARCHTHIS2'
>> ORA-06550: line 2, column 1:
>> PL/SQL: Statement ignored1. BEGIN
>> 2. searchThis2('Here is my search string', 'c');
>> 3. END;
>>
>>
>>
>> What am i missing here? Thanks for your help all!
>> ~ck
>>
>
> Your proc has 3 parameters, and you call it with 2 as it is a fucntion.
> Try this:
>
> CREATE OR REPLACE fucntion searchThis2
>> (m_stringToSearch IN varchar2, m_search varchar2) return number
>> AS
>> BEGIN
>> return INSTR(m_stringToSearch ,m_search , 1,1) ;
>> END;
>
> Shakespeare
>

which should be function, same typo twice.....

and:
(m_stringToSearch IN varchar2, m_search IN varchar2) return number

Shakespeare Received on Thu Nov 08 2007 - 13:39:07 CST

Original text of this message

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