- 1、本文档共27页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
PLSQL编程(PLSQL programming)
PLSQL编程(PLSQL programming)
PL/SQL program block structure (a PL/SQL block can be an anonymous block, process, or function) :
DECLARE - optional
/ * variable, cursor, user-defined special type * /
The BEGIN - must
/ * * / SQL statements
/ * * / PL/SQL statements
The EXCEPTION - optional
/ * processing actions when the error occurs * /
The END; - must be
Example:
DECLARE
V_variable VARCHAR2 (5);
The BEGIN
The SELECT column_name
INTO v_variabe
The FROM table_name;
The EXCEPTION
The WHEN exception_name THEN
...
The END;
PL/SQL data type
PL/SQL variables and constants:
PL/SQL variables:
Scalar: stores a single value, and the generic data types used by scalar variables include characters, Numbers, dates, and Boolean types
Compound: store multiple values
Reference: reference external variables
Example:
SQL VARIABLE emp_num NUMBER
SQL the BEGIN
SELECT COUNT (*) INTO: emp_num
3 the FROM emp;
4 the END;
5 /
The PL/SQL procedure has been successfully completed
SQL PRINT emp_num
EMP_NUM
-- -- -- -- -- -- -- -- -- -- -- -- --
13
LOB (large object) : CLOB (recipe), BLOB (photo), BFILE (movie), NCLOB
External variables:
Bind variables and pivot variables
Note: variables can be in DECLARE and BEGIN... The END section assigns the value, but the constant can only be assigned to the DECLARE section. = the assignment symbol for PL/SQL.
Scope: for a single block, defined the scope of the variable is the block, the parent block variables defined in the scope of the block itself is father, and the nested children.
The variables defined in the subblock are only the subblocks themselves that are part of its scope.
Each line in PL/SQL declares an identifier at most.
Two variables in different blocks can be of the same name.
The name of the variable (identifier) cannot be the same name as the column in the block.
Initialization and keywords of variables:
: = assignment operator
The DEFAULT DEFAULT
NOT NULL is NOT empty
Basic scalar type
VARCHAR2
NUMBER
The DATE
CHAR
LONG
LONG RAW
BOOLEAN
B
您可能关注的文档
- 6XV1830-0EH10,武汉康厦自动化设备有限公司(6XV1830-0EH10, wuhankang mansion automation equipment co., LTD).doc
- 6万发电机组厂用电分配(Electricity distribution for 60,000 generator sets).doc
- 7000 考验单词 五(The test of the word five).doc
- 66-边缘检测算子及其在火焰图像中的应用(66 - edge detection operator and its application in flame image).doc
- 70-曲线运动 万有引力与航天(70 - curve motion gravitation and aerospace).doc
- 7.3 设计与开发的理解要点和审核思路(7.3 design and development understanding key points and review ideas).doc
- 725题3(725 3).doc
- 73使用燃料对环境的影响(73 the impact of fuel on the environment).doc
- 76-辅助物理教学系统的设计(76 - design of auxiliary physics teaching system).doc
- 79种配饵方子(79 species of baits).doc
- 无锡市公安局经开分局会同经开交警大队招聘119名警务辅助人员笔试高频难、易错点备考题库附答案详解.docx
- 曲靖市麒麟区2025年第二批次事业单位遴选(含遴选计划)笔试备考题库及答案详解一套.docx
- 7家智慧社区解决方案集锦,你pick谁.docx
- 江苏地质矿产设计研究院(中国煤炭地质总局检测中心)招聘笔试高频难、易错点备考题库及完整答案详解1套.docx
- 无为市人民法院选聘特邀调解员的笔试备考题库附答案详解.docx
- 最高人民法院直属单位2025年度公开招聘工作人员笔试高频难、易错点备考题库带答案详解.docx
- 汕头市公安局招聘70名警务辅助人员的笔试备考题库带答案详解.docx
- 江苏南京航空航天大学经济与管理学院MBA教育中心工作人员招聘笔试高频难、易错点备考题库含答案详解.docx
- 26、2025年上市公司执行企业会计准则监管报告.docx
- 求是杂志社2025年度公开招聘高校毕业生笔试备考题库及参考答案详解一套.docx
文档评论(0)