Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    5

    Question Unanswered: open cursor for and case inside the select

    OPEN cur FOR
    SELECT
    NVL2(
    (CASE
    WHEN
    (SELECT


    PLS-00103: Encountered the symbol "CASE" when expecting one of the following:

    ( - + mod not null others <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count cur

    Does anybody know how to resolve this?

    Thanks in advance.

    John.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    It appear that you have never gotten close to understanding what's in the fine manual
    http://download-west.oracle.com/docs...a96624/toc.htm
    The gibberish you posted is not even close to being valid PL/SQL syntax.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Feb 2005
    Posts
    5
    Is it?

    Well, I believe that you are accustomed to this code:

    CREATE OR REPLACE FUNCTION TEST_FUNC()
    RETURN Types.ref_cursor
    AS
    cur types.ref_cursor;
    BEGIN
    OPEN cur FOR
    SELECT <something>
    FROM <sometable>
    WHERE <some constraint>;

    RETURN cur;
    END;
    /

    So, instead of using a simple select statement, I want to use a more complicated one that contains a case and I receive that message:

    OPEN cur FOR
    SELECT
    NVL2(
    (CASE
    WHEN
    (SELECT
    ...

    Where do you see the bad syntax?

    John.
    Last edited by jkost; 02-24-05 at 05:16.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •