Dynamic SQL detailed in Oracle

Source: Internet
Author: User

1. static sqlsql and dynamic SQLThe Oracle compiled PL/SQL program block is divided into two types: one for the pre-assembly (early binding), that is, the SQL statement is determined during program compilation, most of the compilation is of this type, and the other is the late-linking (late binding), That is, SQL statements can only be established at run time, for example, when the query condition is user input, then Oracle's SQL engine can not be determined at compile time for the program statement, only after the user entered a certain query criteria to be submitted to the SQL engine for processing.   Typically, static SQL takes the previous compilation, whereas dynamic SQL uses the latter one. This paper mainly discusses the development of dynamic SQL, and finally gives some practical development techniques. 2 . Dynamic SQL program DevelopmentUnderstanding the principle of dynamic SQL compilation, but also mastered its basic development ideas. Since dynamic SQL is an "indeterminate" SQL, its execution has its corresponding characteristics. The Execute immediate statement is provided in Oracle to execute dynamic SQL with the following syntax: http://www.cnblogs.com/gaolonglong/archive/2011/05/31/2064790.html Excute immediate Dynamic SQL statement using-bound parameter list returning into output parameter list; This statement is described as follows: 1) Dynamic SQL refers to DDL and indeterminate DML (that is, DML with parameters) 2) binding parameter list as input parameter list   , which is the type in type, which is bound at run time with the arguments in the dynamic SQL statement (actually placeholders, which can be understood as formal parameters inside the function).   3) The output parameter list is the list of parameters returned after the dynamic SQL statement executes.    4) Since dynamic SQL is determined at runtime, it can lose some system performance in exchange for its flexibility relative to static. More articles: Oracle dynamic SQL Execute immediate notation zt-http://space.itpub.net/14740/viewspace-663092oracle dynamic SQL Assembly Essentials-http:// Mikixiyou.iteye.com/blog/1720563oracle Dynamic sql-http://blog.csdn.net/hncsy403/article/details/7902908

Dynamic SQL detailed in Oracle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.