TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 170

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 170', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Loops The LOOP construct allows you to execute a sequence of statements repeatedly. There are three kind of loops simple infinite FOR and WHILE. You can use the EXIT statement to break out of LOOP and pass control to the statement following the END LOOP. Simple Loop LOOP executablestatement s END LOOP The simple loop should contain an EXIT or EXIT WHEN unless you want it to execute infinitely. Use the simple loop when you want the body of the loop to execute at least once. For example LOOP FETCH company_cur INTO company_rec EXIT WHEN company_cur ROWCOUNT 5 OR company_cur NOTF OUND process_company company_cur END LOOP Numeric FOR Loop FOR loop index IN REVERSE LOOP executablestatement s END LOOP The PL SQL runtime engine automatically declares the loop index a PLS_INTEGER variable never declare a variable with that name yourself. The lowest_number and highest_number ranges can be variables but are evaluated only once on initial entry into the loop. The REVERSE keyword causes PL SQL to start with the highest_number and decrement down to the lowest_number. For example this code BEGIN FOR counter IN 1 . 4 LOOP counter END LOOP FOR counter IN REVERSE 1 . 4 LOOP counter END LOOP END yields the following output 1234 4321 Cursor FOR Loop FOR record index IN cursor name SELECTstatement LOOP executablestatement s END LOOP The PL SQL runtime engine automatically declares the loop index a record of cursor_name ROWTYPE never declare a variable with that name yourself. The cursor FOR loop automatically opens the cursor fetches all rows identified by the cursor and then closes the cursor. You can embed the SELECT statement directly in the cursor FOR loop. For example FOR emp_rec IN emp_cur LOOP IF Oracle Programmer THEN give_raise emp_rec. emp_id 30 END IF END LOOP WHILE Loop WHILE condition LOOP executablestatement s END LOOP Use the .

Đã 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.