Le problème avec les étiquettes dans Portfolio, c’est qu’on ne peut les consulter qu’une par une. Voici donc une requête qui permet de les visualiser toutes à la fois, en sachant pour chacune :
- le type de notice
- la description longue et brève
- les sous-zones autorisées
- les valeurs par défaut des indicateurs et des sous-zones
- si c’est une zone fixe
- si la zone est obligatoire, répétable, protégée
- s’il y a un avertissement quand la notice devient inactive ou supprimée
select case when substr(file_code, 1, 1) = 'A' then 'autorité' when substr(file_code, 1, 1) = 'N' then 'bibliographique' when substr(file_code, 1, 1) = 'C' then 'exemplaires' end as type_notice, case when file_code = 'A' or file_code = 'N' then 'maison' when file_code = 'AC' or file_code = 'NC' then 'contrôle' end as sous_type, tag as zone, t2.description as description, t3.description as description_breve, sub_fields as sous_zones, def_ind1 as indicateur1, def_ind2 as indicateur2, def_val, fix as zone_fixe, protect as zone_protegee, rep as zone_repetable, mandatory as zone_obligatoire, is_warning_ina as avertissement_si_inactive, is_warning_sup as avertissement_si_supprimee from sy_dt_field as t1 inner join sy_dt_description as t2 on t1.desc_id = t2.desc_id inner join sy_dt_description as t3 on t1.desc_id = t3.desc_id where t2.lang = 'FR' and t2.subcode = 'D' and t3.lang = 'FR' and t3.subcode = 'A' order by 1, 3 /* file_code : * A = autorité \ maison * AC = autorité \ contrôle * CC = exemplaires * N = bibliographique \ maison * NC = bibliographique \ contrôle */
Voici un aperçu du résultat dans un tableur :
ou dans une page web :
Et si l’on veut le détail des sous-zones d’une zone précise (ici la zone 182) :
select case when substr(file_code, 1, 1) = 'A' then 'autorité' when substr(file_code, 1, 1) = 'N' then 'bibliographique' when substr(file_code, 1, 1) = 'C' then 'exemplaires' end as type_notice, case when file_code = 'A' or file_code = 'N' then 'maison' when file_code = 'AC' or file_code = 'NC' then 'contrôle' end as sous_type, tag as zone, sub as sous_zone, t2.description, t3.description as description_breve, length as longueur, ponctuation, rep as repetable, mandatory as obligatoire, /*opt as optionnel, not(opt) as obligatoire, */isvalid_codes as liste_de_codes from SY_DT_SUB_FIELD as t1 inner join sy_dt_description as t2 on t1.desc_id = t2.desc_id inner join sy_dt_description as t3 on t1.desc_id = t3.desc_id where tag = '0182' and t2.lang = 'FR' and t2.subcode = 'D' and t3.lang = 'FR' and t3.subcode = 'A' order by t1.file_code, seq