分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

Oracle/PLSQL: FETCH Statement
The purpose of using a cursor, in most cases, is to retrieve the rows from your cursor so that some type of operation can be performed on the data. After declaring and opening your cursor, the next step is to FETCH the rows from your cursor.
译:大多数情况下,使用游标的目的,就是从你的游标中取得行,然后可以对这些数据进行一些操作。声明操作游标后,下一步就是从游标中FETCH行了。
The basic syntax for a FETCH statement is:
FETCH cursor_name INTO <list of variables>;
For example, you could have a cursor defined as:
译:例如,你可以象下面这样定义游标
CURSOR c1
IS
    SELECT course_number
      from courses_tbl
      where course_name = name_in;
The command that would be used to fetch the data from this cursor is:
译:用于从游标中取数据的的命令如:
FETCH c1 into cnumber;
This would fetch the first course_number into the variable called cnumber;
译:这将会把第一个course_number取到名为cnumber的游标中。
Below is a function that demonstrates how to use the FETCH statement.
译:下面是一个演示如何使用FETCH语句的方法。
CREATE OR REPLACE Function FindCourse
   ( name_in IN varchar2 )
   RETURN number
IS
    cnumber number;
    CURSOR c1
    IS
       SELECT course_number
        from courses_tbl
        where course_name = name_in;

BEGIN

open c1;
fetch c1 into cnumber;

if c1%notfound then
     cnumber := 9999;
end if;

close c1;

RETURN cnumber;
END;

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow

Oracle/PLSQL FETCH Statement相关推荐

  1. Oracle/PLSQL Case Statement

    Oracle/PLSQL: Case Statement In Oracle 9i, you can use the case statement within an SQL statement. I ...

  2. Oracle/PLSQL WHERE CURRENT OF Statement

    分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! Orac ...

  3. 【转】oracle PLSQL基础学习

    [转]oracle PLSQL基础学习 --oracle 练习: /**************************************************PL/SQL编程基础****** ...

  4. mysql plsql循环语句吗,Oracle PLSQL 在游标中用while循环实例程序

    Oracle PLSQL 在游标中用while循环实例程序 Oracle PLSQL 在游标中用while循环实例程序 Oracle PLSQL 在游标中用while循环实例程序 declare cu ...

  5. Oracle/PLSQL CURSOR FOR Loop

    分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! Orac ...

  6. lower() oracle,PLSQL LOWER用法及代码示例

    PLSQL LOWER函数用于将指定字符串中的所有字母都转换为小写.如果字符串中的字符不是字母,则不受此功能的影响. 要转换的char可以是任何数据类型,例如CHAR,VARCHAR2,NCHAR,N ...

  7. Oracle PLSQL 导出数据table xx contains one or more CLOB columns 解决方案

    Oracle PLSQL 导出数据table xx contains one or more CLOB columns 解决方案 参考文章: (1)Oracle PLSQL 导出数据table xx ...

  8. oracle中plsql块的结构,oracle plsql的结构

    变量声明部分(没有变量可以不写declare) begin 执行部分 exception 异常处理部分 end *:declare 和 exception部分是可选的 (1)PL/sql中变量的定义 ...

  9. oracle sum函数返回类型,Oracle / PLSQL SUM函数

    这个Oracle教程解释了如何使用Oracle / PLSQL SUM函数. SUM(x) 添加x中的所有值,并返回总和. SUM函数对一组行进行操作,并返回一行输出. Null值被SUM函数忽略.您 ...

最新文章

  1. Python帮助Youtube打败了Google Video
  2. numpy 创建数组
  3. 使用C#格式化字符串 1
  4. 阿里云发布ECS磁盘加密,一键加密,业务0改动
  5. java 自定义 转换器_Java笔记之SpringMVC(七):自定义String到Date的类型转换器
  6. 折纸计算机大全,神之折纸电脑版
  7. nrf51822笔记之密码配对过程梳理
  8. 51nod 1412 AVL数的种类(DP
  9. java基础---File类
  10. codeforces 几道题目
  11. install ADT plugin
  12. sstap tun虚拟网卡没有安装_虚拟设备之TUN和TAP
  13. 用户信息填写web代码_zabbix监控系列之监控项(8、web监控)
  14. CodeSmith学习笔记(一):设置属性为打开文件,保存文件
  15. 常见的web前端性能优化方法总结
  16. nginx SPDY 堆缓冲区溢出
  17. gradle 使用 exclude 解决jar包冲突
  18. 120550-35-8,Biotin-PFP ester生物素-五氟苯酯与伯氨基(-NH2)反应
  19. vue+axios上传文件的几种方式及步骤(以上传图片为例)
  20. /tmp/ccAceHhY.o: In function `main': main.c:(.text+0xc7): undefined reference to `dlopen' main.c:

热门文章

  1. 解读革命性容器集群CCE Turbo:计算、网络、调度全方位加速
  2. 30年技术积累,技术流RTC如何成为视频直播领域的黑马?
  3. Rust 算法排位记 - 插入排序的图示和代码实现
  4. 【经验分享】如何搭建本地MQTT服务器(Windows ),并进行上下行调测
  5. 野生前端的数据结构练习(10)希尔排序,归并排序,快速排序
  6. linux设置send时间,[转]Socket 的send,recv在windows与linux下的超时设置
  7. C++ 堆区和栈区的区别
  8. 引入LeakCanary到项目
  9. 联想小新pro无法人脸识别自动开机的解决方法
  10. 如何设置input表单根据表单内的数据自动增高_「第三天」学美术的英语小白如何从装修行业转为互联网前端...