1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
Sub test()
Const adChar = 129, adParamOutput = 2, adCmdText = 1
Sql = "with q1 as (
select
intervention.objet_id as id_interne_aurion,
evenement.debut AS "Début.Événement",
intervenant.ind_nom AS "Nom.Intervenant",
D1.valeur AS "Libellé.Module",
D2.valeur AS "Libellé.Type d'activité",
ressource.code AS "Code.Ressource",
evenement.fin AS "Fin.Événement",
D3.valeur AS "Libellé.Type de ressource"
from (select o.* from v_interventions_filtrees_par_service o where true and not o.obsolete) intervention
left join auriga.t_evenements evenement on evenement.objet_id = intervention.evenement_id
left join auriga.t_intervenants_evenements R1 on R1.evenement_id = evenement.objet_id
left join auriga.t_individus intervenant on intervenant.objet_id = R1.intervenant_id
left join auriga.t_evenements_cours R2 on R2.evenement_id = evenement.objet_id
left join auriga.t_cours cours on cours.objet_id = R2.cours_id
left join auriga.t_relations R3 on R3.source_id = intervention.objet_id and R3.relation_nom = 'intervention-matiere'
left join auriga.t_matieres matiere on matiere.objet_id = R3.dest_id
left join auriga.t_relations R4 on R4.source_id = R3.rel_objet_id and R4.relation_nom = 'intervention-matiere-type_enseignement'
left join auriga.t_types_activite type_enseignement on type_enseignement.objet_id = R4.dest_id
left join auriga.t_interventions_ressources R5 on R5.intervention_id = intervention.objet_id
left join auriga.t_ressources ressource on ressource.objet_id = R5.ressource_id
left join auriga.t_types_ressource type_ressource on type_ressource.objet_id = ressource.type_ressource_id
left join auriga.t_multilangues D1 on (D1.objet_id, D1.attribut_id, D1.langue_id) = (cours.objet_id, 561, 94577)
left join auriga.t_multilangues D2 on (D2.objet_id, D2.attribut_id, D2.langue_id) = (type_enseignement.objet_id, 781, 94577)
left join auriga.t_multilangues D3 on (D3.objet_id, D3.attribut_id, D3.langue_id) = (type_ressource.objet_id, 471, 94577)
where (true
and (evenement.debut >= current_date and evenement.debut < (current_date+1))
)
)
select
distinct
id_interne_aurion,
q1."Nom.Intervenant",
q1."Libellé.Module",
q1."Libellé.Type d'activité",
(cast(cast(q1."Début.Événement" as timestamp) as time)) as "Seulement heure ,Début.Événement",
(cast(cast(q1."Fin.Événement" as timestamp) as time)) as "Seulement heure ,Fin.Événement",
q1."Code.Ressource",
q1."Libellé.Type de ressource"
from q1
where true /* and id_interne_aurion= any(('{' || $P{ObjectID_List} || '}')::integer[]) */;"
With CreateObject("ADODB.Command")
.ActiveConnection = Connexion
.CommandType = adCmdText 'adCmdFile=256,adCmdStoredProc=4,adCmdTable=2,adCmdTableDirect=521,adCmdText=1,nknown=8
.CommandTimeout = 500
.CommandText = Sql
.Parameters.Append CreateObject("ADODB.Command").CreateParameter("Test", adChar, adParamOutput, 50, "TOTO") 'ChampsName,TypeChamps, Directionr, size, Value
Set CommadExecute = .Execute
End With
End Sub |