Results 1 to 3 of 3

Thread: ora 01008 error

  1. #1
    Join Date
    Nov 2008

    Unanswered: ora 01008 error

    for i in 1..35 loop
    l_sql :='select :new.answer'||i||' from dual' ;

    execute immediate l_sql into vsql ;

    end loop;

    i wanna store the value into a variable .
    it is giving me this error ora 01008
    how shud i do this??????

  2. #2
    Join Date
    Sep 2002
    Provided Answers: 1
    What are you actually trying to do? Is this code part of a trigger? I'll assume it is. The problem is that :new is being treated as a bind variable in dynamic SQL, not as the trigger :new pseudovariable.

    There is no way to access :new.answer1, :new.answer2, ... etc. using a loop counter as part of the name - it just doesn't work. You'll have to forego the loop and type:

    vsql := :new.answer1;
    vsql := :new.answer2;
    vsql := :new.answer35;

  3. #3
    Join Date
    Mar 2007
    Just in addition to andrewst, you may generate the trigger code from the dictionary, as described in this thread on AskTom:

Posting Permissions

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