자바에서 아래처럼 쿼리를 만들어서 실행을 하니까 에러가 발생했습니다.
오라클에서의 lineview를 템프를 이용하여 변경을 했는데..
인포믹스의 클라이언트 프로그램에서는 이상이 없는데..
어디서 에러가 나는지 알수 가 없습니다.
고수님들의 의견 부탁 드립니다.
소스의 일부입니다.
sql = new StringBuffer();
sql.append( " select a.vendor_code, a.buyer_bank_name, \n ");
sql.append( " cc.lc_no, a.pay_terms, a.inv_dely_terms, a.bl_no, \n ");
sql.append( " cc.bl_amt lc_blamt, a.pay_text, \n ");
sql.append( " a.bl_amt bl_amt, \n ");
sql.append( " a.inv_cur, \n ");
sql.append( " max(b.permit_date) per, \n ");
sql.append( " a.house_code, a.company_code, a.bl_code \n ");
sql.append( " from icocblhd a, outer icocbllc cc , icoccure b \n ");
sql.append( " where a.house_code='"+house_code+"' \n ");
sql.append( " and a.house_code=b.house_code \n ");
sql.append( " and a.house_code = cc.house_code \n ");
sql.append( " and a.bl_code = cc.bl_code \n ");
sql.append( " and a.company_code='"+company_code+"' \n "); sql.append( " and a.company_code=b.company_code \n ");
sql.append( " and a.bl_code = b.ref_no \n ");
sql.append( " and b.permit_date > ' ' \n ");
sql.append( " and a.status in ('C','R') \n ");
if( seller.length() > 0 )
sql.append( " and a.vendor_code='"+seller+"' \n ");
if( bank_code.length() > 0 )
sql.append( " and a.buyer_bank_code='"+bank_code+"' \n ");
if( lc_no.length() > 0 )
sql.append( " and cc.lc_no = '" + lc_no + "' \n " );
if( bl_no.length() > 0 )
sql.append( " and a.bl_no='"+bl_no+"' \n ");
sql.append( " and not exists \n ");
sql.append( " (select 'A' from icoclcph \n ");
sql.append( " where house_code=a.house_code \n ");
sql.append( " and bl_code = a.bl_code \n ");
sql.append( " and nvl(lc_no, ' ') = nvl(cc.lc_no, ' ') \n ");
sql.append( " and status in ('C','R')) \n ");
sql.append( " group by a.vendor_code, a.buyer_bank_name, \n ");
sql.append( " cc.lc_no, a.pay_terms, a.inv_dely_terms, a.bl_no, \n ");
sql.append( " cc.bl_amt, a.pay_text, \n ");
sql.append( " a.bl_amt, \n ");
sql.append( " a.inv_cur, \n ");
sql.append( " a.pay_terms, \n ");
sql.append( " a.house_code, a.company_code, a.bl_code \n ");
sql.append( " into temp p4010_temp1 with no log; \n ");
sql.append( " select c.vendor_code, c.buyer_bank_name, c.lc_no, c.inv_cur, \n ");
sql.append( " nvl(d.lc_amt, 0), \n ");
sql.append( " c.pay_terms, c.inv_dely_terms, c.pay_text, c.bl_no, \n ");
sql.append( " decode( nvl( c.lc_blamt, 0 ), 0, c.bl_amt, c.lc_blamt ), \n ");
sql.append( " c.per, c.bl_code \n ");
sql.append( " from p4010_temp1 c, "+out+" icomlchd d \n ");
sql.append( " where c.house_code=d.house_code \n ");
sql.append( " and c.company_code=d.company_code \n ");
sql.append( " and c.lc_no = d.lc_no \n ");
if ( lc_no.length() > 0 )
sql.append( " and d.status in ('C','R') \n " );
else
sql.append( " and d.status <> 'D' \n ");
sql.append( " order by c.vendor_code, c.bl_code; \n ");
sql.append( " drop table p4010_temp1; \n ");
|