Re: Parameterized Cursors: Help Please.

From: <winde_at_informatik.fh-wolfenbuettel.de>
Date: 1996/03/26
Message-ID: <4j89t1$im_at_thorin.rz.fh-wolfenbuettel.de>#1/1


Steve Shiflett <shiflett_at_lmsc.lockheed.com> wrote:
>I want to pass a value to a stored procedure for a case insensitive
>search. Here is what I do:
>----------------
>
>CREATE OR REPLACE PROCEDURE search_movie
> ( my_title IN varchar2 )
>IS
> answer char;
>BEGIN
> DECLARE
> CURSOR c1( c_title char) IS
> SELECT title FROM movie
> WHERE UPPER( title ) LIKE UPPER( '%c_title%' );

I think you want something like this:

   CURSOR c1( c_title char) IS

      SELECT title FROM movie
      WHERE UPPER( title ) LIKE UPPER( '%'||c_title||'%' );

c_titel is a variable and you must combine it with || to the string.

>select title from movie where upper(title) like upper('%g%');
Here you search for title that have an 'g' but up you search for 'c_title' in title!

Hope I helped you :-)

Tina Received on Tue Mar 26 1996 - 00:00:00 CET

Original text of this message