运行查询并找到错误

时间:2014-05-03 07:47:17

标签: sql oracle

我正在尝试此查询,但在& CLEARED_FLAG

上发现错误
  

ORA-00933:SQL命令未正确结束

SELECT vch_locn_code
      ,vch_vch_type
      ,vch_vch_#
      ,vch_srl_#
      ,vch_bank_code
      ,vch_instrmt_type
      ,vch_instrmt_num
      ,vch_instrmt_date
      ,vch_instrmt_amt
      ,vch_drawn_at
      ,vch_payable_at
      ,vch_dshnr_flag
      ,vch_rcln_flag
      ,vch_rcln_date
      ,vch_trns_type
      ,vch_payee_name
      ,vch_bv_date
      ,vch_clear_date
      ,dd_no
      ,dd_dt
      ,cleared_dt
  FROM fac_vch_bv
 WHERE vch_bv_date BETWEEN :from_date AND :to_date
   AND vch_locn_code = :locn_code
   AND vch_vch_# IN (SELECT DISTINCT vch_vch_#
                       FROM fac_vch_d
                      WHERE vch_gl_code = :bank_code
                        AND vch_dbcr = (SELECT decode(:bank_receipt, 'Y', 'D', 'N', 'C') FROM dual)
                        AND vch_vch_type = '0102')
   AND vch_vch_# IN (SELECT vch_vch_#
                       FROM fac_vch_m
                      WHERE vch_vch_type = '0102'
                        AND vch_bank_code = :bank_code) &cleared_flag
 ORDER BY vch_instrmt_num
         ,vch_instrmt_date

0 个答案:

没有答案