From 9fe033ea88c2f705ec18c232873d056e0c229d72 Mon Sep 17 00:00:00 2001 From: Gaspard Coulet Date: Wed, 28 Apr 2021 23:05:53 +0200 Subject: Initial commit --- sem_5/HLIN511_BDD/tp4.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sem_5/HLIN511_BDD/tp4.sql (limited to 'sem_5/HLIN511_BDD/tp4.sql') diff --git a/sem_5/HLIN511_BDD/tp4.sql b/sem_5/HLIN511_BDD/tp4.sql new file mode 100644 index 0000000..e98fd7c --- /dev/null +++ b/sem_5/HLIN511_BDD/tp4.sql @@ -0,0 +1,11 @@ +declare +cursor c is select num_ab,count(num_ex) as nb_emprunt from Emprunt group by num_ab; +begin +for c_t in c +loop +insert into ab_nb values (c_t.num_ab,c_t.nb_emprunt); +end loop; +exception when no_data_found +insert into ab_nb values (c_t.num_ab,-1); +end; +/ -- cgit v1.2.3