title: Declaring and using variables in PL-SQL
body: <p>I am new to PL-SQL.  I do not understand why I am getting the error "PLS-00428: an INTO clause is expected in this SELECT statement"</p>
  
  <p>What I'm trying to accomplish is to create a variable c_limit and load it's value.  I then want to use that variable later to filter data.</p>
  
  <p>Basically I am playing around in the demo db to see what I can/can't do with PL-SQL.</p>
  
  <p>The code worked up to the point that I added "select * from demo_orders where CUSTOMER_ID = custID;"</p>
  
  <pre><code>declare 
  c_limit NUMBER(9,2);
  custID INT;
  
  BEGIN
    custID := 6;
  
    -- Save the credit limit
    select credit_limit INTO c_limit
    from  demo_customers cust
    where customer_id = custID;
  
    select * from demo_orders where CUSTOMER_ID = custID;
  
    dbms_output.Put_line(c_limit);
  END;
  </code></pre>