Đang chuẩn bị liên kết để tải về tài liệu:
Oracle XSQL- P14

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Oracle XSQL- P14Welcome to the exciting world of eXtended Structured Query Language (XSQL) development! What’s so exciting? Efficiency and ease of use. XSQL isn’t some razzle-dazzle technology to wow your users. It also isn’t the latest X standard du jour that no one can stop talking about until you ask, “But what does it do for me today?” The problem with all of the great stuff out there is that no one technology does it all. | 240 Chapter 9 The WHILE LOOP moves the EXIT condition to the top of the loop SET SERVEROUTPUT ON DECLARE dummy_var NUMBER 2 BEGIN dummy_var 1 WHILE dummy_var 15 LOOP DBMS_OUTPUT.PUT_LINE dummy_var dummy_var dummy_var dummy_var 1 END LOOP END The FOR LOOP is most convenient for this kind of loop. It handles the counting for you. You are also guaranteed that the FOR LOOP will exit PL SQL won t let you assign to the counter while the loop is in progress. SET SERVEROUTPUT ON BEGIN FOR dummy_var IN 1.15 LOOP DBMS_OUTPUT.PUT_LINE dummy_var dummy_var END LOOP END Sequential Control Structures The sequential control structures are the GOTO and the NULL statements. You shouldn t use GOTO statements in your code even if it is really complicated. Instead you should try to simplify your code and probably write some subroutines. If you really really have to write a GOTO here is how you do it statement statement GOTO goto_target statement statement statement goto_target statement you want to go to The NULL statement does nothing. It is convenient as a placeholder and generally should be removed after development. During development you might need it PL SQL 241 because of PL SQL s requirement that each block have at least one valid statement. If you have constructed a complicated series of IF-THEN-ELSE statements you might find that you don t want a particular block to do anything. However your PL SQL won t execute without a valid statement. Instead of disturbing the overall structure of your code you can just throw in a NULL statement. In this way you meet both goals The code will run and the problem block won t do anything. Here s an example IF a b THEN NULL END IF Cursors Earlier in this chapter in the section entitled Declaring Variables you got your first glimpse of cursors. Now you get to see them in action. A cursor allows you to programmatically move through the results of a SQL query. Here is an example SET SERVEROUTPUT ON DECLARE CURSOR emp_cursor IS SELECT FROM emp .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.