`

oracle复合数据类型学习五——pl/sql记录

阅读更多
--如何使用复合数据类型
--一、pl/sql记录
--1、在select into中自定义pl/sql记录
declare
-- 自定义记录变量类型
type comtype_record_type is record(
id communitytype.community_type_id%type,
name communitytype.name%type
);
--自定义变量
comtype_record comtype_record_type;
begin
select ct.community_type_id,ct.name into comtype_record
from communitytype ct
where ct.community_type_id = 'ebook';
dbms_output.put_line(comtype_record.name);
end;
--2、在select into中自定义pl/sql记录
declare
-- 自定义记录变量类型
type comtype_record_type is record(
id communitytype.community_type_id%type,
name communitytype.name%type
);
--自定义变量
comtype_record comtype_record_type;
begin
select ct.community_type_id,ct.name into comtype_record.id,comtype_record.name
from communitytype ct
where ct.community_type_id = 'ebook';
dbms_output.put_line(comtype_record.name);
end;
--2、在insert中自定义pl/sql记录
declare
comtype_record communitytype%type;
begin
comtype_record.community_type_id:='wlcb';
comtype_record.name:='网络出版';
from communitytype ct
insert into communitytype values comtype_record;
--或者insert into communitytype(community_type_id,name) 
--values (comtype_record.community_type_id,comtype_record.name);
end;


分享到:
评论

相关推荐

    Oracle PL/SQL程序设计(第5版)(套装上下册)

    《Oracle PL/SQL程序设计(第5版)(套装上下册)》基于Oracle数据库11g,从PL/SQL编程、PL/SQL程序结构、PL/SQL程序数据、PL/SQL中的SQL、PL/SQL应用构建、高级PL/SQL主题这6个方面详细系统地讨论了PL/SQL以及如何...

    Oracle PL/SQL语言初级教程

    PL/SQL是Oracle对标准数据库语言的扩展,Oracle公司已经将PL/SQL整合到Oracle 服务器和其他工具中了,近几年中更多的开发人员和DBA开始使用PL/SQL,本教程将以循速渐进的方式讲述PL/SQL基础语法,结构和组件、以及...

    oracle10g_pl/sql

    oracle10g pl/sql完备教程,供初学者学习与开发者参考

    Oracle PL SQL程序设计 上 第五版(代码示例)

    《oracle pl/sql程序设计(第5版)》基于oracle数据库11g,从pl/sql编程、pl/sql程序结构、pl/sql程序数据、pl/sql中的sql、pl/sql应用构建、高级pl/sql主题6个方面详细系统地讨论了pl/sql以及如何有效地使用它。...

    Oracle PL/SQL实例编程(PL/SQL经典书籍)

    Oracle PL/SQL实例编程 Oracle PL/SQL实例编程 Oracle PL/SQL实例编程

    PL/SQL 用户指南与参考

    第三章 PL/SQL数据类型 第四章 PL/SQL的控制结构 第五章 PL/SQL集合与记录 第六章 PL/SQL与Oracle间交互 第七章 控制PL/SQL错误 第八章 PL/SQL子程序 第九章 PL/SQL包 第十章 PL/SQL对象类型 第十一章 本地...

    PL/SQL Developer v8.0.zip

    报告——PL/SQL Developer提供内置的报告功能,您可以根据程序数据或Oracle字典运行报告。PL/SQL Developer本身提供了大量标准报告,而且您还可以方便的创建自定义报告。自定义报告将被保存在报告文件中,进而包含在...

    oracle PL/SQL pdf学习资料

    oracle PL/SQL pdf学习资料oracle PL/SQL pdf学习资料oracle PL/SQL pdf学习资料oracle PL/SQL pdf学习资料oracle PL/SQL pdf学习资料

    PL/SQL Developer 6.05注册版-1

    <br>报告——PL/SQL Developer提供内置的报告功能,您可以根据程序数据或Oracle字典运行报告。PL/SQL Developer本身提供了大量标准报告,而且您还可以方便的创建自定义报告。自定义报告将被保存在报告文件中,...

    精通Oracle 10g SQL和PL/SQL

    本书是专门为oracle开发人员而提供的编程指南 通过学习本书 读者不仅可以掌握编写sql语句和pl/sql块的基础知识 而且还可以掌握sql高级特征 正则表达式 flashback查询 merge语句 sql:1999连接 和pl/sql高级特征 ...

    Oracle 9i Java程序设计——使用PL/SQL和Java的解决方案

    原书名:Oracle 9i Java Programming <br>Oracle 9i Java程序设计——使用PL/SQL和Java的解决方案 <br>【原出版社】 Wrox Press 【作 者】Bjarki Holm,John Carnell等 【译 者】 康博 【丛 ...

    Oracle PL/SQL程序设计(第5版)(下册)第二部分

    《Oracle PL/SQL程序设计(第5版)》基于Oracle数据库11g,从PL/SQL编程、PL/SQL程序结构、PL/SQL程序数据、PL/SQL中的SQL、PL/SQL应用构建、高级PL/SQL主题这6个方面详细系统地讨论了PL/SQL以及如何有效地使用它。...

    oracle 9i pl/sql程序设计笔记

    oracle 9i pl/sql程序设计笔记。

    Oracle PL/SQL学习官方教材

    Oracle PL/SQL学习官方教材,英文版,覆盖了PL/SQL的所有知识,适合入门者或作为参考资料.

    Oracle PL/SQL programming(5th Edition)

    Topics covered: How to use Oracle PL/SQL in all its manifestations through Oracle9i. Fundamentals of program structure (loops, cases, exceptions, etc.) and execution get attention, as do data types, ...

    PL/SQL User's Guide and Reference (官方CHM)

    PL/SQL, Oracle's procedural extension of SQL, is an advanced fourth-generation programming language (4GL). It offers modern features such as data encapsulation, overloading, collection types, ...

    PL/SQL Developer9.06

    PL/SQL Developer是一个集成开发环境,专门面向Oracle数据库存储程序单元的开发。如今,有越来越多的商业逻辑和应用逻辑转向了Oracle Server,因此,PL/SQL编程也成了整个开发过程的一个重要组成部分。PL/SQL ...

    Oracle PL/SQL programming

    Considered the best Oracle PL/SQL programming guide by the Oracle community, this definitive guide is precisely what you need to make the most of Oracle’s powerful procedural language. The sixth ...

    PL/SQL Developer 7.1.5 注册版-3

    <br>报告——PL/SQL Developer提供内置的报告功能,您可以根据程序数据或Oracle字典运行报告。PL/SQL Developer本身提供了大量标准报告,而且您还可以方便的创建自定义报告。自定义报告将被保存在报告文件中,...

    Oracle 12c PL/SQL程序设计终极指南

    PL/SQL本身涉及的知识点浩瀚、庞杂,初学者根本无法依靠自身能力理清头绪,学习成本极高.本书对知识点进行了体系化的梳理,化繁杂为有序,突出重点,直指核心,循序渐进,尽可能为学习者提供“捷径”,仅仅只是这...

Global site tag (gtag.js) - Google Analytics