Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Noida, India.

    Question Unanswered: Command line parameters to plsql script

    I wanted to insert 10 records in a table.

    I wrote a plsql block with the insert statement in a loop that executes 10 times. The value for this insert statement is '&key' and '&val' these can be entered with the script prompts me.

    But, plsql, while parsing prompts for the values only once.
    And then executes the loop 10 times with these values.

    For inserting 10 records, i found an alternative, which is manual.

    Was interested in knowing if oracle has any feature that a plsql script prompts user for inputs for each time the loop is executed? I sincerely believe, there should be an approach to it which I dont know.

    Any inputs will be highly appreciated.

    Oracle can do wonders !

  2. #2
    Join Date
    Sep 2002
    Provided Answers: 1

    Re: Command line parameters to plsql script

    Server PL/SQL can't prompt for inputs at all - not even once! It was SQL Plus that prompted you for values for the substitution variables &key and &val, and made the substitutions before sending the PL/SQL block to the server. The server knows nothing about &key and &val.

    You would need to write code in a more sophisticated client tool than SQL Plus (e.g. Oracle Forms, Pro*C, Visual Basic, ...) where you can write code with loops and prompt for user input within the loop.

Posting Permissions

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