亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問(wèn)板塊 發(fā)新帖
查看: 2212 | 回復(fù): 4
打印 上一主題 下一主題

游標(biāo)嵌套問(wèn)題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2010-12-29 16:11 |只看該作者 |倒序?yàn)g覽
set serveroutput on;
declare
  v_last_time date;
  v_cardnum cardmast.cardnum%type;   
  v_table_name audtrail.table_name%type;
  v_fid_name audtrail.fld_name%type;
  v_index_1 audtrail.index_1%type;
  v_index_2 audtrail.index_2%type;
  v_index_3 audtrail.index_3%type;
  v_index_4 audtrail.index_4%type;
  v_before_val audtrail.before_val%type;
  v_after_val audtrail.after_val%type;
  v_change_data audtrail.change_date%type;
  v_change_time audtrail.change_time%type;
  v_fld_type audtrail.fld_type%type;
  v_comments audtrail.comments%type;
  c_user audtrail.user_id%type;   
  cursor card_cursor is  
  select cardnum from cardmast,temp_cif where cardmast.cif=temp_cif.cif;
   
  cursor aud_cursor(v_time date,v_index audtrail.index_1%type) is  
  select * from audtrail where index_1 = v_index and change_date = v_time;
begin
        select last_eod_date into v_last_time from eod_ctrl;
dbms_output.put_line('ok---------'||v_last_time);   
  open card_cursor;
  begin
  fetch next from card_cursor into @v_last_time;
  while(@@fetch_status = 0)   
  open aud_cursor;
  fetch next from aud_cursor into v_table_name,v_fid_name,v_index_1,v_index_2,v_index_3,v_index_4,v_before_val,v_after_val,
  c_user,v_change_data,v_change_time,v_fld_type,v_comments;
  while(@@fetch_status = 0)
  begin
  fetch next from aud_cursor into v_table_name,v_fid_name,v_index_1,v_index_2,v_index_3,v_index_4,v_before_val,v_after_val,
  c_user,v_change_data,v_change_time,v_fld_type,v_comments;
  end;
  close aud_cursor;
  deallocate aud_cursor;
  fetch next from card_cursor into @v_last_time;
  end;
  close card_cursor;
  deallocate card_cursor;
  exception
  when no_data_found then
dbms_output.put_line('the audtrail!');
  when others then
  dbms_output.put_line('no reason');
end;
/
報(bào)錯(cuò)
  fetch next from card_cursor into @v_last_time;
  *
ERROR at line 27:
ORA-06550: line 27, column 17:
PLS-00103: Encountered the symbol "FROM" when expecting one of the following:
. into bulk
請(qǐng)問(wèn)怎么解決,想了兩天了,未解決~

論壇徽章:
59
2015七夕節(jié)徽章
日期:2015-08-24 11:17:25ChinaUnix專家徽章
日期:2015-07-20 09:19:30每周論壇發(fā)貼之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38榮譽(yù)版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年紀(jì)念徽章
日期:2015-07-20 11:05:27IT運(yùn)維版塊每日發(fā)帖之星
日期:2015-07-20 11:05:34操作系統(tǒng)版塊每日發(fā)帖之星
日期:2015-07-20 11:05:36程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-07-20 11:05:40數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-07-20 11:05:432015年辭舊歲徽章
日期:2015-07-20 11:05:44
2 [報(bào)告]
發(fā)表于 2010-12-29 21:16 |只看該作者
游標(biāo)嵌套容易出錯(cuò)。

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2010-12-30 09:38 |只看該作者
我把代碼更改了一下,但是運(yùn)行的速度好慢呀,這樣是不行的,請(qǐng)問(wèn)這種情況怎么解決呀,難道用多表查詢嗎?

open  card_cursor;
      loop
       fetch card_cursor into  v_cardnum;
       exit when card_cursor%notfound;
        dbms_output.put_line('yes1'||v_cardnum);
        open aud_cursor(v_last_time,v_cardnum);
        loop
        fetch aud_cursor into v_table_name,v_fid_name,v_index_1,v_index_2,v_index_3,v_index_4,v_before_val,v_after_val,
        c_user,v_change_data,v_change_time,v_fld_type,v_comments;
        exit when aud_cursor%notfound;        
         dbms_output.put_line('oh!you like me');
        end loop;
        close aud_cursor;
      end loop;
    close card_cursor;

論壇徽章:
59
2015七夕節(jié)徽章
日期:2015-08-24 11:17:25ChinaUnix專家徽章
日期:2015-07-20 09:19:30每周論壇發(fā)貼之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38榮譽(yù)版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年紀(jì)念徽章
日期:2015-07-20 11:05:27IT運(yùn)維版塊每日發(fā)帖之星
日期:2015-07-20 11:05:34操作系統(tǒng)版塊每日發(fā)帖之星
日期:2015-07-20 11:05:36程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-07-20 11:05:40數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-07-20 11:05:432015年辭舊歲徽章
日期:2015-07-20 11:05:44
4 [報(bào)告]
發(fā)表于 2010-12-30 09:54 |只看該作者
游標(biāo)套游標(biāo),當(dāng)然慢了啊。

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2010-12-31 16:01 |只看該作者
是要用多表查詢,這樣效率會(huì)快一點(diǎn)嗎?
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP