ORA-00971:缺少SET关键字(DBD ERROR:错误可能接近< *>指示符,位于' UPDATE / * + INDEX(c I_CHARGE_SERVICE)

时间:2014-04-23 11:36:38

标签: oracle perl partitioning

UPDATE /*+ INDEX(c I_CHARGE_SERVICE) */ charge c partition(CHARGE_P0024)
   SET c.general_10 = (SELECT decode(((decode(daa.result3_value,
                                              0,
                                              0,
                                              null,
                                              0,
                                              1)) +
                                     (decode(c.general_10, null, 1, 0, 1, 0)) +
                                     (decode(c.tariff_id,
                                              1001427,
                                              0,
                                              60040,
                                              0,
                                              1001205,
                                              0,
                                              5060553,
                                              0,
                                              60021,
                                              0,
                                              1000804,
                                              0,
                                              60016,
                                              0,
                                              1000345,
                                              0,
                                              1))),
                                     3,
                                     '1',
                                     '0') || '|' || sh.service_subtype ||
                              decode(c.tariff_id,
                                     5060249,
                                     '|' ||
                                     decode(c.general_10, '0', '1', '0'),
                                     5060250,
                                     '|' ||
                                     decode(c.general_10, '0', '1', '0'),
                                     5060251,
                                     '|' ||
                                     decode(c.general_10, '0', '1', '0'),
                                     '')
                         FROM service_history sh, derived_attribute_array daa
                        WHERE sh.service_id = c.service_id
                          AND c.charge_date between sh.effective_start_date and
                              sh.effective_end_date
                          AND daa.derived_attribute_id(+) = 1000209
                          AND sh.service_subtype = daa.index1_value(+)
                          AND c.charge_date between
                              daa.effective_start_date(+) and
                              daa.effective_end_date(+))
 WHERE c.service_id in
       (select /*+ INDEX(s P_SERVICE) */
         s.service_id
          from service s
         WHERE mod(s.service_id, :p1) = :p2) /* global mod value = loop counter bind variable*/
   AND c.tariff_id in
       ('1000105', '5060553', '1001427', '5060372', '60016', '5060249',
        '1001407', '60021', '60015', '60022', '60013', '1001205', '5060250',
        '60018', '1000345', '5060377', '60040', '5060251', '1000804') /* global tariff list */
   AND ((c.general_10 is null) or (instr(c.general_10, '|') = 0))
   AND c.invoice_id is null
   AND c.uninvoiced_ind_code = 1

我错过了SET关键字,尽管关键字位于适当的位置。 查询已经执行过,现在收到此错误。

有人可以帮助确定我所缺少的内容......?

1 个答案:

答案 0 :(得分:0)

在第一行移动表别名,如下所示:

UPDATE /*+ INDEX(c I_CHARGE_SERVICE) */ charge partition(CHARGE_P0024) c