Oracle Syntax Logging

Source: Internet
Author: User

-Three Forms of loop (1). LOOP (2). While ... Looop (3). For ... LOOP1. Basic Loop statement set Serveroutput on;--exit ... when end loop declare v_value number (8): =-3;    BEGIN <<value_loop>>-loop tag loop dbms_output.put_line (' V_value = ' | | v_value);    V_value: = v_value+1;  EXIT Value_loop when V_value > 3;    END LOOP; Dbms_output.put_line (' Loop loop is over! ‘); end;--If ... exit end loop declare v_value number (8): =-3;    BEGIN <<value_loop>> Loop Dbms_output.put_line (' Value: ' | | v_value);    V_value: = V_value +1;      IF v_value > 3 then Dbms_output.put_line (' value was larger than 3, current value is ' | | v_value);    EXIT Value_loop;  END IF;    END LOOP Value_loop; Dbms_output.put_line (' Loop is end '); End;2.while. Loop structure itself can end the loop declare v_value number (8): =-3;       BEGIN <<while_loop>> while (V_value < 4) loop Dbms_output.put_line (' value is ' | | v_value);  V_value: = V_value + 1;  END LOOP While_loop; Dbms_output.put_line (' While loop iS end '); End;3. For ...  The loop structure can traverse a range integer begin for V_value IN-3..3 LOOP dbms_output.put_line (' value is ' | | v_value);  END LOOP; Dbms_output.put_line (' For loop is End ');  end;--Oracle Time Sysdate system time systimestamp the current system timestamp Current_timestamp related to the time zone setting, the returned seconds are system, and the returned date and time are converted according to the time zone. Current_date Is the rounding of the Current_timestamp exactly to the second.  Select Sysdate,systimestamp,current_date,current_timestamp from dual;--oracle sequence create SEQUENCE Seq_tt_trms_car_task START with 1INCREMENT by 1NOMAXVALUEMINVALUE 1NOCYCLENOCACHEcurrval: Returns the current value of sequence Nextval: Returns the value of the increment sequence, Then return the value of sequence select Seq_tt_trms_car_task.currval from dual; SELECT Seq_tt_trms_car_task.nextval from dual;--sql%rowcount the number of rows affected by the Oracle variable

  

Oracle Syntax Logging

Related Article

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.