⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nomatch.sql

📁 Oracle 9i PL/SQL程序设计的随书源码
💻 SQL
字号:
REM NoMatch.sql
REM Chapter 6, Oracle9i PL/SQL Programming by Scott Urman
REM This script illustrates the use of cursor attributes on the
REM implicit SQL cursor.

BEGIN
  UPDATE rooms
    SET number_seats = 100
    WHERE room_id = 99980;
  -- If the previous UPDATE statement didn't match any rows, 
  -- insert a new row into the rooms table.
  IF SQL%NOTFOUND THEN
    INSERT INTO rooms (room_id, number_seats)
      VALUES (99980, 100);
  END IF;
END;
/

BEGIN
  UPDATE rooms
    SET number_seats = 100
    WHERE room_id = 99980;
  -- If the previous UPDATE statement didn't match any rows, 
  -- insert a new row into the rooms table.
  IF SQL%ROWCOUNT = 0 THEN
    INSERT INTO rooms (room_id, number_seats)
      VALUES (99980, 100);
  END IF;
END;
/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -