1 / 6

ORACLE PL/SQL

ORACLE PL/SQL. Records. Εγγραφές ( Records ). DECLARE TYPE t_Rec1Type IS RECORD ( Field1 NUMBER, Field2 VARCHAR2(5)); TYPE t_Rec2Type IS RECORD ( Field1 NUMBER, Field2 VARCHAR2(5)); v_Rec1 t_Rec1Type; v_Rec2 t_Rec2Type; BEGIN

Télécharger la présentation

ORACLE PL/SQL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ORACLE PL/SQL Records

  2. Εγγραφές (Records) DECLARE TYPE t_Rec1Type IS RECORD ( Field1 NUMBER, Field2 VARCHAR2(5)); TYPE t_Rec2Type IS RECORD ( Field1 NUMBER, Field2 VARCHAR2(5)); v_Rec1 t_Rec1Type; v_Rec2 t_Rec2Type; BEGIN /* αν και το v_Rec1 και το v_Rec2 έχουν συνώνυμα πεδία, οι τύποι εγγραφών διαφέρουν. Δεν ισχύει η δήλωση v_Rec1 := v_Rec2; Αλλά οι παρακάτω δηλώσεις είναι σωστές*/ v_Rec1.Field1 := v_Rec2.Field1; v_Rec2.Field2 := v_Rec2.Field2; END;

  3. %ROWTYPE set serveroutput on size 1000000; declare t_person emp%ROWTYPE; begin Select * into t_person from emp where empno=7788; dbms_output.put_line(t_person.ename); end; /

  4. Στυλ γραφής -Σχόλια DECLARE V_pwk number; -- Βαρος πιπεριου σε κιλα V_pgpc3 number; -- Κοκκοι ανα κυβικο εκατοστο BEGIN /* ** Διαδικασια «ΠΩΣ ΤΟ ΤΡΙΒΟΥΝ ΤΟ ΠΙΠΕΡΙ» **asto 23/5/2010 */ Calc_num_of_monks; -- ανευρεση απαιτουμενου προσωπικου .... END

  5. Ονόματα μεταβλητών v_=Variable e_=Exception t_ =Type p_=Parameter c_=Constant

More Related