Results 1 to 3 of 3

Thread: Select into

  1. #1
    Join Date
    Mar 2002
    Posts
    20

    Angry Unanswered: Select into

    Hi!

    Having a bit of trouble selecting into: -

    logic := 'select 1, 2
    from tblA
    into varA, varB'

    execute immediate logic;

    What am I doing wrong?

    Cheers!

  2. #2
    Join Date
    Sep 2003
    Location
    Virginia, USA
    Posts
    246
    you failed to select into something. execute immediate causes Oracle to treat your work as a PL/SQL block, and you cannot select in a PL/SQL block unless you select into variables.

    the kind of command you showed is generally not suitted to using the execute immediate command, but I guess it was just an example.

    the execute immediate command has an INTO clause you need to read about.

    -Mark

  3. #3
    Join Date
    Mar 2002
    Posts
    20

    Talking

    Bingo!

    logic := 'select 1,2 into :varA, :varB from tblA'

    execute immediate into varA, varB;

Posting Permissions

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