Download presentation
Presentation is loading. Please wait.
1
Chapter 2 Anonymous Block
Dasar Pemrograman Basis Data MI2163
2
Block Types unnamed blocks are not stored in the database
3
Create An Anonymous Block
Type the anonymous block in SQLPlus environment: SQL> BEGIN 2 DBMS_OUTPUT.PUT_LINE('Hello World'); 3 END; 4 / Hello World PL/SQL procedure successfully completed.
28
Creating A PL/SQL Records
32
The %ROWTYPE Attribute
33
Inserting a Record Using %ROWTYPE
34
Updating a Row in a Table Using a Record
42
Example of Bind Variables in SQLPlus Environment
SQL> VARIABLE v_word1 VARCHAR2(5); SQL> VARIABLE v_word2 VARCHAR2(5); SQL> BEGIN 2 :v_word1:='Hello'; 3 :v_word2:='World'; 4 DBMS_OUTPUT.PUT_LINE(:v_word1||' '||:v_word2); 5 END; 6 / Hello World PL/SQL procedure successfully completed.
45
Example of Substitution Variables in SQLPlus Environment
SQL> -- input nilai menggunakan variabel substitusi SQL> DECLARE 2 v_word1 VARCHAR2(5):= '&input1'; 3 v_word2 VARCHAR2(5):= '&input2'; 4 BEGIN 5 DBMS_OUTPUT.PUT_LINE(v_word1||' '||v_word2); 6 END; 7 / Enter value for input1: Hello Enter value for input2: World Hello World PL/SQL procedure successfully completed.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.