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

📄 recordassignment.sql

📁 Oracle 9i PL/SQL程序设计的随书源码
💻 SQL
字号:
REM RecordAssignment.sql
REM Chapter 3, Oracle9i PL/SQL Programming by Scott Urman
REM This block shows legal and illegal record assignments.

DECLARE
  TYPE t_Rec1Type IS RECORD (
    Field1 NUMBER,
    Field2 VARCHAR2(5));
  TYPE t_Rec2Type IS RECORD (
    Field1 NUMBER,
    Field2 VARCHAR2(5));
  v_Rec1 t_Rec1Type;
  v_Rec2 t_Rec2Type;
BEGIN
  /* Even though v_Rec1 and v_Rec2 have the same field names
     and field types, the record types themselves are different.
     This is an illegal assignment which raises PLS-382. */
  v_Rec1 := v_Rec2;

  /* However, the fields are the same type, so the following
     are legal assignments. */
  v_Rec1.Field1 := v_Rec2.Field1;
  v_Rec2.Field2 := v_Rec2.Field2;
END;
/

⌨️ 快捷键说明

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