1CREATE [OR REPLACE] PROCEDURE procedure_name
2 [ (parameter [,parameter]) ]
3
4IS
5 [declaration_section]
6
7BEGIN
8 executable_section
9
10[EXCEPTION
11 exception_section]
12
13END [procedure_name];
1
2
3
4
5 CREATE OR REPLACE PROCEDURE print_contact(
6 in_customer_id NUMBER
7)
8IS
9 r_contact contacts%ROWTYPE;
10BEGIN
11 -- get contact based on customer id
12 SELECT *
13 INTO r_contact
14 FROM contacts
15 WHERE customer_id = p_customer_id;
16
17 -- print out contact's information
18 dbms_output.put_line( r_contact.first_name || ' ' ||
19 r_contact.last_name || '<' || r_contact.email ||'>' );
20
21EXCEPTION
22 WHEN OTHERS THEN
23 dbms_output.put_line( SQLERRM );
24END;
25
1CREATE PROCEDURE nome_procedura [(parametri)] IS
2 Definizioni;
3BEGIN
4 Corpo procedura;
5END;