Plsql Introduction (i) "Translation"

Source: Internet
Author: User

Plsql Introduction (i) "Translation"

Original book: Steven Feuerstei-oracle plsql grogramming 2014

PL/SQL stands for "Structured Query language and procedural language." Oracle Corporation has introduced PL/SQL to overcome some of the limitations and provide a more complete programming solution.

What is Plsql

Oracle's PL/SQL language has several defining characteristics:
It is a highly structured, readable and easy-to-use language, and PL/SQL is a good starting point if you are unfamiliar with programming. You'll find out.
It is an easy-to-learn language and has clear keywords and structures to express the intent of your code. If you have experience with other programming languages, you will easily adapt to the new syntax.
It is a standard and portable language developed by Oracle, and if you write a PL/SQL process or function to execute a database in Oracle sitting on your laptop, you can move the same process to the database to execute it on your corporate network without making any changes. Once written, running everywhere is the slogan of PL/SQL long before Java appears. But for PL/SQL, ubiquitous means "Oracle database Everywhere".

It is an embedded language PL/SQL is not designed to be used as a standalone language, but in a host environment. So, for example, you can run a PL/SQL program from the database (for example, via the * * Plus interface). Alternatively, you can define and execute a PL/SQL program in an Oracle De-veloper form or report (this method is called client PL/SQL). However, you cannot create a PL/SQL executable file that you can run on your own.

It is a high-performance, highly integrated database language. You now have a lot of choices when writing software to run the Oracle database. You can use Java and JDBC; You can use Visual Basic and ODBC; You can use Delphi,c + + and so on. However, you will find it easier to write efficient code in any other language to access the Oracle database in PL/SQL. In particular, Oracle provides some PL/SQL-specific enhancements, such as forall statements, that can improve database performance by an order of magnitude or more.

Plsql origins

Oracle has been leading the software industry, providing declarative, non-procedural approaches to database and application design. Oracle server technology is one of the most advanced, powerful and stable relational databases in the world. Its application development tools, such as Oracle Forms, provide a high level of productivity by relying heavily on the "draw screen" approach, allowing developers to avoid onerous custom program settings.

Plsql earlier versions

In the early stages of Oracle, the declarative approach to SQL combined with its groundbreaking relational technology was sufficient to meet the needs of developers. But as the industry grows, expectations rise and demand becomes more stringent. Developers need to get something deeper into the product. They need to build complex guidelines, exceptions, and rules in forms and database scripts.

In 1988, Oracle released Oracle version 6, a major progressive database technology for its relationship. A key component of this release is the so-called procedural options, or PL/SQL. Almost at the same time, Oracle released a long-awaited upgrade to SQL * Forms version 2.3 (now known as Oracle's product's original name table or form developer). SQL * Forms v3 contains the PL/SQL engine, the first time in terms of tooling, allowing developers to write their program logic in a natural, straightforward way.

The first release of PL/SQL is very limited in its capabilities. On the server side, you can only use PL/SQL to build a "batch" script for the process and for the status of the state. You cannot construct a modular application or store business rules in the server. On the client side, SQLFraseV3.0 does allow you to create procedures and functions, and although support for functions is not documented, they have not been used by many developers for years. In addition, this publication, PL/SQL, is not supported by an array and cannot interact with the operating system (input and output). This is a far cry from a mature programming language.

But because of all of its limitations, PL/SQL has been enthusiastic, even enthusiastic, in the developer community. The desire for the ability to write simple if statements in SQL * forms is strong. The need to execute multiple SQL statement batches is overwhelming.

Few developers at the time realized that the original motivations and drivers behind PL/SQL were beyond the need for programmatic control of the internal products such as those in the forms. Early in the life cycle of Oracle databases and tools, Oracle has recognized two key weaknesses in its architecture: lack of portability and enforcement of permissions issues.

Improved portability

For people who are familiar with Oracle, the concerns about portability can be a bit strange poration marketing and technical strategies. One of the hallmarks of Oracle Solutions-
From the early 1980s onwards, it was the transplant line. When PL/SQL appears, the C-based database runs on many different operating systems and hardware platforms. SQL * Plus and SQL * forms make it easy to adapt to a variety of terminal configurations. However, with all these reports, there are still many applications that require granular control in more complex host languages such as COBOL,C and Fortran. As soon as developers get out of Port-neutral Oracle Tools, the final application will no longer be portable.

The PL/SQL language is (and is) a tool that is designed to extend the scope of application and can be fully processed in operating system-independent programming. Java and other programming languages today provide similar portability. However, PL/SQL stands out as an early pioneer in the field, and of course, it continues to allow developers to write highly portable applications.

Improved execution rights limited to transactional integrity

A more basic problem than portability is the execution permissions. Database SQL language allows you to tightly control access and changes to any particular content
Database tables. For example, with the grant command, you can ensure that only certain roles and users can perform an update on a given table. On the other hand, this grant command does not ensure that the user makes the correct order of execution for most businesses for one or more tables.

The PL/SQL language provides strict control and management of logical transactions. On the one hand, PL/SQL is implemented by implementing permissions. Instead, granting a role or user permission to update a table grants permission only to perform a procedure that controls and provides access to the underlying data structure. This process is owned by different Oracle database schemas (the "definition"). Then, grant the update permissions for those tables that require transactions. The program is therefore called the "gatekeeper" of the transaction. The only way a program, whether it is a oracle-forms or an pro-c executable, is through this process, the integrity of the application's transactions is guaranteed from this point of view.

Plsql Introduction (i) "Translation"

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.