title: PL/SQL: how do I prompt user input in a procedure?
body: <p>This is a question about a small part of a large project I'm doing. I tried the following but I just get the two errors below it:</p>
  <pre><code>SET SERVEROUTPUT ON
  
  CREATE OR REPLACE PROCEDURE HELLO AS
  DECLARE
  variable1 NUMBER(1);
  variable2 CHAR(1);
  
  BEGIN
  DBMS_OUTPUT.PUT_LINE('Hello World');
  variable1 := &amp;please_enter_1_or_0;
  variable2 := &amp;please_enter_y_or_n;
  END;
  /
  </code></pre>
  <blockquote>
  <p>Error(2,5): PLS-00103: Encountered the symbol &quot;DECLARE&quot; when expecting
  one of the following:     begin function pragma procedure subtype type
       current
  cursor delete    exists prior external language The symbol &quot;begin&quot; was
  substituted for &quot;DECLARE&quot; to continue.</p>
  <p>Error(10,8): PLS-00103: Encountered the symbol &quot;end-of-file&quot; when
  expecting one of the following:     ( begin case declare end exception
  exit for goto if loop mod    null pragma raise return select update
  while with     <br />
   &lt;&lt; continue close current delete fetch lock<br />
  insert open rollback savepoint set sql execute commit forall    merge
  pipe purge</p>
  </blockquote>
  <p>We were given a markscheme of how our code would be marked, and for this section, the relevant criteria would be:</p>
  <p>&quot;Does the script use a procedure?&quot; and</p>
  <p>&quot;Does the script prompt for right/wrong and team/individual and handle the data provided correctly?&quot;.</p>
  <p>The project brief quotes &quot;Develop a procedure that prompts for RIGHT/WRONG (using &amp;), then updates table&quot; (where table is the name of a table).</p>
  <p>The purpose of the variables was to update an existing record attribute. i.e. if user chose 1 and n then update the null in the record to 2. if it was 1 and y then update to 1, and if 0 and y/n then update to 0.</p>