首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • 求一个oracle的存储过程,使用游标的 [无满意答案结贴,结贴人:wipe_tear]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-03-29 21:35:51 楼主
    RT,求一个oracle存储过程
    使用游标的,最好有输入输出,
    20  修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • kokobox
    • 等级:
    发表于:2008-03-29 21:47:441楼 得分:0
    呵呵,在我的blog上有写这个问题。

    里面也有代码和讲解

    有时间你可以去看看,对你应该有帮助,因为写的很多,不方便写在这里面

    http://user.qzone.qq.com/67622728
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-03-31 16:41:572楼 得分:0
    大哥哥,你那叫例子吗
    I 服了 you
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • chenhongxin
    • 等级:
    发表于:2008-03-31 16:57:363楼 得分:0
    哈哈,叫哥,我就给你发一个
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • chenhongxin
    • 等级:
    发表于:2008-03-31 16:59:394楼 得分:0
    create  or  replace  procedure  sp_test(p_date  in  varchar2)  is
    type  t_cursor  is  ref  cursor;
    v_str  varchar(1000);
    v_cur  t_cursor;
    r_cur  计量点表码表200701%rowtype;
    begin
      v_str  :=  'select  *  from  计量点表码表 ' ¦ ¦p_date ¦ ¦ '  ';
      open  v_cur  for  v_str;
      loop
      Fetch  v_cur  into  r_cur;
      exit  when  v_cur%notfound;
      dbms_output.put_line( 'the  result  is:  ' ¦ ¦r_cur.计量点编码 ¦ ¦ '  ' ¦ ¦r_cur.费率类型);
      end  loop;
      close  v_cur;
    end  sp_test;
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • chenhongxin
    • 等级:
    发表于:2008-03-31 17:00:015楼 得分:0
    declare  @name  varchar(20)

    declare  t_cursor  cursor  for 
    select  name  from  syscolumns 
    where  id=object_id( 'test1 ')  and  colid> 1  order  by  colid

    open  t_cursor

    fetch  next  from  t_cursor  into  @name

    while  @@fetch_status=0
    begin
            exec( 'select  '+@name+ '  as  t  into  test3  from  test1 ')
            set  @s= 'insert  into  test2  select  ' ' '+@name+ ' ' ' '
            select  @s=@s+ ', ' ' '+rtrim(t)+ ' ' ' '  from  test3
            exec(@s)
            exec( 'drop  table  test3 ')
            fetch  next  from  t_cursor  into  @name
    end
    close  t_cursor
    deallocate  t_cursor

    修改 删除 举报 引用 回复

    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    世纪乐知(北京)网络技术有限公司 提供技术支持
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved