- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
类似于高级语言中的结构体类型,处理表中的单行多列数据。 * * The %TYPE Attribute When you declare PL/SQL variables to hold column values, you must ensure that the variable is of the correct datatype and precision. If it is not, a PL/SQL error will occur during execution. Rather than hard coding the datatype and precision of a variable, you can use the %TYPE attribute to declare a variable according to another previously declared variable or database column. The %TYPE attribute is most often used when the value stored in the variable will be derived from a table in the database or if the variable is destined to be written out to it. To use the attribute in place of the datatype required in the variable declaration, prefix it with the database table and column name. If referring to a previously declared variable, prefix the variable name to the attribute. PL/SQL determines the datatype and size of the variable when the block is compiled, so it is always compatible with the column used to populate it. This is a definite advantage for writing and maintaining code, because there is no need to be concerned with column datatype changes made at the database level. You can also declare a variable according to another previously declared variable by prefixing the variable name to the attribute. Class Management Note The %TYPE attribute has some overhead, in that a SELECT statement is issued against the database to obtain the datatype. If the PL/SQL code is in a client tool, the SELECT must be executed each time the block is executed. If the PL/SQL code is a stored procedure, the column or definition is stored as part of the P-code. However, if the table definition changes, a recompile is forced. * 定义并声明一个 PL/SQL 记录 创建一个记录,需先用RECORD 定义这个复合数据类型,然后再声明这个类型的记录。 在语法中: type_name RECORD 类型的名字 (该标识符用来声明记录)。 field_name 记录内字段的名字。 field_type 字段的数据类型 (除了 REF CURSOR 外,可以是任何一个PL/SQL 数据类型。可以使 用%TYPE 和 %ROWTYPE 属性。) expr 可以是 field_type 或 一个初始值。 NOT NULL 用来限定这些字段值不能赋空值,必须对字段初始化后才能用NOT NULL 来限定的字段。
您可能关注的文档
- 201308级4班 吴秋东 心理PPT作业.ppt
- 201309计1主题班会良好行为,规范自我.ppt
- 201301第一章 职业生涯规划导论.ppt
- 201301-概述.ppt
- 20131.1.2笑迎心生活.ppt
- 20131.1积极应对新生活.ppt
- 20131.1 我上中学.ppt
- 20131.1 我上中学了 黎雯娜.ppt
- 20131.4 城市光环境.ppt
- 201301-概述yuan.ppt
- 2026年消防设施操作员之消防设备基础知识考试题库500道带答案(新).docx
- 销售岗前培训课件.ppt
- 2026年消防设备操作员考试题库500道(典型题).docx
- 2026年消防设施操作员之消防设备高级技能考试题库300道附答案(实用).docx
- 2026年消防设施操作员之消防设备高级技能考试题库300道标准卷.docx
- 2026年材料员之材料员基础知识考试题库300道附完整答案(全优).docx
- 2026年材料员之材料员基础知识考试题库300道带答案(培优a卷).docx
- 2026年机械员考试题库含答案(轻巧夺冠).docx
- 2026年材料员之材料员基础知识考试题库300道【夺分金卷】.docx
- 2026年期货从业资格之期货法律法规考试题库500道(考点精练).docx
文档评论(0)