Select in PL-SQL Errors: INTO After Select

Posted by levi on Stack Overflow See other posts from Stack Overflow or by levi
Published on 2012-10-16T09:22:57Z Indexed on 2012/10/16 11:01 UTC
Read the original article Hit count: 270

Filed under:
|
|
|
|

I've the following query in a test script window

declare
  -- Local variables here
  p_StartDate date := to_date('10/15/2012');
  p_EndDate   date := to_date('10/16/2012');
  p_ClientID  integer := 000192;
begin
  -- Test statements here
  select d.r                          "R",
         e.amount                     "Amount",
         e.inv_da                     "InvoiceData",
         e.product                    "ProductId",
         d.system_time                "Date",
         d.action_code                "Status",
         e.term_rrn                   "IRRN",
         d.commiount                  "Commission",
         0                            "CardStatus"
    from docs d
   inner join ext_inv e on d.id = e.or_document
   inner join term t on t.id = d.term_id
   where d.system_time >= p_StartDate
     and d.system_time <= p_EndDate
     and e.need_r = 1
     and t.term_gr_id = p_ClientID;
end


Here is the error:
ORA-06550: line 9, column 3: PLS-00428: an INTO clause is expected in this SELECT statement
I've been using T-SQL for a long time and I'm new to pl-sql What's wrong here?

© Stack Overflow or respective owner

Related posts about sql

Related posts about database