database - What are set-at-a-time operations and in what situation would processing a set of data be needed to be done by the application program -
Question:
What is set on the operation of a time, The set is done on the set
Cheers.
If all the relevant data is in the Oracle database, then the processing process
< P>
Code> section, etc. Mailers can solve any programming problem. It does not necessarily mean that everything should be done in a single SQL statement. As you feel comfortable with those features, your SQL statements will get bigger and faster, and the total amount of code will be reduced. But there is always a point where regular old procedural codes are more understandable.
Your basic description is partly correct: "Cursors set for DBMS in a one-time process." Line-per-line processing with a cursor is usually the opposite of set-based processing. But Oracle can still do some work to make some parts of the processes set-based. For example, for example, look at this simple code to join an EMPLOYEE and DEPARTMENT tables and print the results.
Start for employee and / department (employee.employee_name, department.department_name from employee department department employee.department_id = employee.department_id by employee_name) Loop DBMS_output.page_line (employee employee) _name || ',' || Department. Name of the division); End loop; End; For each line: 1) Use the index to retrieve an employee record, 2) In order to see the relevant line in the department records, use the index 3) Return one line 4) Print a result
The description varies depending on the execution plan, but it is more likely to process on an anonymous block:
1) Hush the department table and Store in memory 2) Join it with employee table 3) Results of order 4) Recover 100 rows at one time, and for each line: 4a) Print a result
SQL operations and data retrieval are often done in bulk without requesting. A part of the statement is still making row-per-line, but most heavy loads are automatically done in batches. Even when procedural PL / SQL is converted into declarative SQL, there is room for large scale improvement, but despite many code benefits from set-based processing,
Comments
Post a Comment