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

📄 allthree.sql

📁 Oracle 9i PL/SQL程序设计的随书源码
💻 SQL
字号:
REM allthree.sql
REM Chapter 3, Oracle9i PL/SQL Programming by Scott Urman
REM This block contains all three sections - declarative, executable,
REM and exception.

DECLARE
  /* Start of declarative section */
  v_StudentID NUMBER(5) := 10000;  -- Numeric variable initialized
                                   -- to 10,000
  v_FirstName VARCHAR2(20);        -- Variable length character string
                                   -- with maximum length of 20
BEGIN 
  /* Start of executable section */
  -- Retrieve first name of student with ID 10,000
  SELECT first_name
    INTO v_FirstName
    FROM students
    WHERE id = v_StudentID;
EXCEPTION
  /* Start of exception section */
  WHEN NO_DATA_FOUND THEN
    -- Handle the error condition
    INSERT INTO log_table (info)
      VALUES ('Student 10,000 does not exist!');
END;
/

⌨️ 快捷键说明

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