存儲過程編譯時遇到如下的錯誤,如何解決? 在線等 ( 积分: 50 )

  • 主题发起人 主题发起人 ks_reny
  • 开始时间 开始时间
K

ks_reny

Unregistered / Unconfirmed
GUEST, unregistred user!
CREATE&nbsp;OR&nbsp;REPLACE&nbsp;Procedure&nbsp;Get_TBLAPSCF&nbsp;(itemcodes&nbsp;in&nbsp;varchar2,months&nbsp;in&nbsp;varchar2)<br>As<br>Begin<br>&nbsp;&nbsp;Insert&nbsp;into&nbsp;TBLAPSCF(item_code,kind,month)<br>&nbsp;&nbsp;Values(itemcodes,'客戶交期',months);<br>&nbsp;&nbsp;Insert&nbsp;into&nbsp;TBLAPSCF(item_code,kind,month)<br>&nbsp;&nbsp;Values(itemcodes,'制ㄧ課',months);<br>&nbsp;&nbsp;Insert&nbsp;into&nbsp;TBLAPSCF(item_code,kind,month)<br>&nbsp;&nbsp;Values(itemcodes,'制二課',months);<br>&nbsp;&nbsp;Insert&nbsp;into&nbsp;TBLAPSCF(item_code,kind,month)<br>&nbsp;&nbsp;Values(itemcodes,'制三課',months);<br>&nbsp;&nbsp;Insert&nbsp;into&nbsp;TBLAPSCF(item_code,kind,month)<br>&nbsp;&nbsp;Values(itemcodes,'生管課',months);<br>&nbsp;&nbsp;Insert&nbsp;into&nbsp;TBLAPSCF(item_code,kind,month)<br>&nbsp;&nbsp;Values(itemcodes,'品管課',months);<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S1=(Select&nbsp;Area&nbsp;From&nbsp;CUSTOMERDATE_AREA&nbsp;Where&nbsp;itemcode=itemcodes&nbsp;and&nbsp;to_char(ops_date,'mm')=months&nbsp;and&nbsp;to_char(ops_date,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='客戶交期'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S1=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制ㄧ課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制ㄧ課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S1=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制二課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制二課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S1=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制三課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制三課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S1=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='生管課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='生管課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S1=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='品管課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='品管課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N1=(Select&nbsp;OPS_QNTY&nbsp;From&nbsp;CUSTOMERDATE_AREA&nbsp;Where&nbsp;itemcode=itemcodes&nbsp;and&nbsp;to_char(ops_date,'mm')=months&nbsp;and&nbsp;to_char(ops_date,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='客戶交期'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N1=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制ㄧ課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制ㄧ課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N1=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制二課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制二課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N1=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制三課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制三課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N1=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='生管課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='生管課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N1=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='品管課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=1)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='品管課'&nbsp;and&nbsp;month=months;<br>......<br>......<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S31=(Select&nbsp;Area&nbsp;From&nbsp;CUSTOMERDATE_AREA&nbsp;Where&nbsp;itemcode=itemcodes&nbsp;and&nbsp;to_char(ops_date,'mm')=months&nbsp;and&nbsp;to_char(ops_date,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='客戶交期'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S31=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制ㄧ課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制ㄧ課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S31=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制二課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制二課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S31=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制三課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制三課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S31=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='生管課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='生管課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;S31=(Select&nbsp;Area&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='品管課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='品管課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N31=(Select&nbsp;OPS_QNTY&nbsp;From&nbsp;CUSTOMERDATE_AREA&nbsp;Where&nbsp;itemcode=itemcodes&nbsp;and&nbsp;to_char(ops_date,'mm')=months&nbsp;and&nbsp;to_char(ops_date,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='客戶交期'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N31=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制ㄧ課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制ㄧ課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N31=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制二課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制二課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N31=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='制三課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='制三課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N31=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='生管課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='生管課'&nbsp;and&nbsp;month=months;<br>&nbsp;&nbsp;Update&nbsp;TBLAPSCF<br>&nbsp;&nbsp;Set&nbsp;N31=(Select&nbsp;PCS&nbsp;From&nbsp;work_item_area&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;Work_code='品管課'and&nbsp;to_char(sysdate,'mm')=months&nbsp;and&nbsp;to_char(sysdate,'dd')=31)<br>&nbsp;&nbsp;Where&nbsp;item_code=itemcodes&nbsp;and&nbsp;kind='品管課'&nbsp;and&nbsp;month=months;<br>Commit;<br>End;<br>編譯時,報下面的錯誤.<br>PLS-00123:&nbsp;程式太大<br>如何處理呀.我的存儲過程有1100行左右.
 
用注释的方法缩小范围,最终找到错误所在就可以了,这么多行代码,不要期望别人给你找
 
代码太多了,就像DELPHI一行只能有255个字符一样<br>用日期循环,内层用update
 
后退
顶部