Oracle's object-oriented and collection-oriented

Source: Internet
Author: User

This is a summary of the recent study of their own experience

I. Oracle's object-oriented

SQL is a collection-oriented one that everyone knows, but there is no denying that there are many places in Oracle today that embody object-oriented thinking. (This is also a symptom of the main language of the same)

Why is there a lot of object-oriented thinking in Oracle? For example, I think the best manifestation of this is the cursor, and of course the package

Begin  DECLARE      cursor students     is        select Sid,name,age,hobby from My_test;     Student Students%rowtype;  Begin for    student in students Loop      dbms_output.put_line (' study number: ' | | student.sid| | ' Student's name: ' | | student.name| | ' ; ');    End Loop;  End;end;  --run result number: 76 student name: Joy; Student number: 77 students ' name: Joy; Number: 78 Student's name: Joy; Number: 79 Student Name: Joy; Number: 80 Student's name: Joy; Number: 81 student Name: Joy; Number: 82 Student Name: Joy Number: 83 student Name: Joy; Student Number: 84 students ' name: Joy; Number: 85 Student's name: Joy; Number: 86 student name: Joy; Number: 87 Student's name: Joy; School Number: 88 student Name: Joy; Number: 89 student name: Joy;

Does the For loop have a bright of foreach in C #?

Student.sid have no object of bright?

The package is also a very strong object-oriented guy, such as the most commonly used dbms_output.put_line () and so on some of the built-in functions, there are object-oriented classes and methods of bright, but Oracle is not so called. Object-oriented is a mode of thinking, perhaps Oracle in the continuous updating process has also borrowed some of this content, so that developers more quickly and more comfortable use is probably.

Next talk about Oracle's collection-oriented

Ii. Oracle's collection-oriented

SQL is set-oriented, and in the Oracle collection this blog has written some of its own, highlighting some of its own insights in this area.

Relational database is based on a certain relationship between the business data in accordance with a certain degree of integration, SQL statement is to better deal with this data exists, so want to improve the efficiency of SQL, many times need to know how Oracle works, he is running a SQL statement, is the order in which to implement their own data processing, which involves the interpretation plan and execution plan.

ORACLE10G uses a cost-based optimizer (CBO) to run one of the many execution plans with some statistics, which is not necessarily the most efficient and stable.

The idea of a collection to program, is to reduce the data block read as much as possible, because in general the cost of the I/O is still very efficient, and the use of a set-oriented approach can also make SQL look more concise, elegant and moving. But these need a process


Finally, borrow someone else's words, make a Hutouhunao end: Anyone can write computer-aware code, but only a thoughtful programmer can write code that everyone can read


Oracle's object-oriented and collection-oriented

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.