Oracle PL Sql过程迄今为止

时间:2018-11-06 09:39:55

标签: oracle plsql

ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at "PREPAID_USER.CREDO_TERMINAL_MONITORING", line 8
ORA-06512: at line 3

当我尝试从具有BETWEEN日期的基础获取一些信息时,出现此错误。在“总计”中,我希望获得从dd / mm / yyyy 10:00到dd + 1 / mm / yyyy 10:00

的所有金额。

这是我的代码

create or replace package body CREDO_TERMINAL_MONITORING is

 procedure get_terminal_amounts(v_terminal_name VARCHAR2,
                             v_start_date    VARCHAR2,
                             v_end_date      VARCHAR2,
                             o_cursor        out sys_refcursor) is
begin
open o_cursor for
  select SUM(e.amount / 100) as Amount,
         SUM(d.commission_reseller_amount / 100)
    from documents d
   inner join ext_invoices e
      on e.original_document = d.id
   inner join terminals t
      on d.terminal_id = t.id
   inner join products p
      on p.id = d.requested_product_id
   inner join terminal_groups tg
      on tg.id = t.terminal_group_id
   inner join vw_prod_groups v
      on v.id = p.id
   inner join clients c
      on c.id = d.client
   where t.name = v_terminal_name
     and e.incoming_date BETWEEN
         TO_DATE(v_start_date, 'dd-mm-yyyy hh24:mi') AND
         TO_DATE(v_end_date, 'dd-mm-yyyy hh24:mi')
     and d.function_code = 865
   order by d.system_time desc;
end CREDO_TERMINAL_MONITORING;

1 个答案:

答案 0 :(得分:0)

您缺少结束过程语句,程序包应以以下结尾:

  end get_terminal_amounts;

end CREDO_TERMINAL_MONITORING;