Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > ETL > Talend
Talend Forum d'entraide sur Talend (Talend Open Studio, ...). Avant de poster --> FAQ Talend, Tutoriels Talend
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 29/08/2011, 11h15   #1
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
Par défaut requête exécutée dans le referentiel metadonnées mais pas dans un job! pourquoi?

Bonjour à tous,
S'il vous plait, je suis bloqué, j'ai une requête à exécuter.
Je peux l’exécuter dans la partie des metadonnées / connexions / requêtes (à gauche dans l'onglet référentiel), j'ai enregistré cette requête et je l'ai utiliser dans mon job avec un tdbinput, et lorsque j'exécute le job il affiche une erreur:java.sql.SQLException: [SQL0104] Elément syntaxique <FIN-INSTRUCTION> n'est pas correct. Éléments possibles : ( + - ? : DAY INF NAN NOT RID ROW,
si la requête est exécutable dans le référentiel metadonnées, pourquoi elle n'est pas exécutable dan un job simple avec uniquement un tdbinput qui relié avec un fichier excel en sortie, je ne comprends pas, est ce que quelqu'un a une explication je suis vraiment bloqué !!!
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/08/2011, 11h20   #2
Membre actif
 
Avatar de sofiane_bfm007
 
Consultant Décisionnel
Inscription : mai 2008
Messages : 261
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : Consultant Décisionnel

Informations forums :
Inscription : mai 2008
Messages : 261
Points : 187
Points : 187
Envoyer un message via MSN à sofiane_bfm007
Bonjour,

Peux-tu poster la requête que tu as utilisé ??
__________________
Business Intelligence : Talend, Cognos 8, SAS 9.2, ODI
sofiane_bfm007 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/08/2011, 11h35   #3
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
Voila la requête, est un peut complexe mais exécutable dans le référentiel metadonnées:
select
'1' As Departement, RegionOperationnelle as NomDepartement,
bai.d01ste as societe, d01rs1 as NomSociete,
g10mdg as Mandat,
d30nm1 as NomImmeuble,
g10ges as Gestionnaire,
d65lib as NomGestionnaire,
d03trs as Locataire,
SoldeAvantTrimestre,
Encaissement,
case when Encaissement > 0
then
case when SoldeAvantTrimestre >= 0
then 0
else
case when Encaissement + SoldeAvantTrimestre <= 0 then Encaissement else SoldeAvantTrimestre * -1 end
end
else 0
end as EncaissementPourCompenserDebit,
SoldeADateArrete,
Quittancement,
case when Encaissement = 0
then 0
else
case when Quittancement = 0
then 1
else
case when abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / Quittancement ) > 1
then abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / Quittancement )
else abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / Quittancement )
end
end
end as TauxEncaissementInstantane,
case when SoldeAvantTrimestre + Quittancement = 0
then 1
else
case when abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantTrimestre + Quittancement ) ) > 1
then abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantTrimestre + Quittancement ) )
else abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantTrimestre + Quittancement ) )
end
end as TauxEncaissementCumule,
substring ( cast ( DebutPeriode as char ( 8 ) ) , 7 , 2 ) || '/' ||
substring ( cast ( DebutPeriode as char ( 8 ) ) , 5 , 2 ) || '/' ||
substring ( cast ( DebutPeriode as char ( 8 ) ) , 1 , 4 )
as DebutPeriode,
substring ( cast ( DateArrete as char ( 8 ) ) , 7 , 2 ) || '/' || substring ( cast ( DateArrete as char ( 8 ) ) , 5 , 2 ) || '/' || substring ( cast ( DateArrete as char ( 8 ) ) , 1 , 4 ) as DateArrete,
substring ( cast ( 100 + day ( current date ) as char ( 3 ) ) , 2 , 2 ) || '/' ||
substring ( cast ( 100 + month ( current date ) as char ( 3 ) ) , 2 , 2 ) || '/' ||
cast ( year ( current date ) as char ( 4 ) )
as DateTraitement
from
(
select
mdg.d01ste, mdg.g10mdg, d30nm1, g10ges, d03trs,
case when SoldeAvantTrimestre is null then 0 else SoldeAvantTrimestre end as SoldeAvantTrimestre,
case when Quittancement is null then 0 else Quittancement end as Quittancement,
case when Encaissement is null then 0 else Encaissement end as Encaissement,
case when SoldeADateArrete is null then 0 else SoldeADateArrete end as SoldeADateArrete
from
(
select d01ste, g10mdg, d30nm1, g10ges
from fbase1.g10mdg0
inner join simco.bx_FGironDatArr DatArr
on g10agd * 10000 + g10mgd * 100 + g10jgd <= DateArrete
and ( g10agf = 0 or g10agf * 10000 + g10mgf * 100 + g10jgf >= DateArrete )
) mdg
left outer join
(
select d01ste, g10mdg, d03trs,
sum ( case when c04ade * 10000 + c04mde * 100 + c04jde < DebutPeriode then g30mon else 0 end ) * -1 as SoldeAvantTrimestre,
sum (
case when

(
( select count ( * ) from simco.bx_ro where departement = 'VB' ) = 0
and c04ade * 10000 + c04mde * 100 + c04jde >= DebutPeriode
)
or

(
( select count ( * ) from simco.bx_ro where departement = 'VB' ) > 0
and c04ade * 10000 + c04mde * 100 + c04jde between DebutPeriode and FinPeriode
)
then
case when g30mon > 0 then g30mon else 0 end
else 0
end
) * -1 as Quittancement,
sum (
case when c04ade * 10000 + c04mde * 100 + c04jde >= DebutPeriode
then
case when g30mon > 0 then 0 else g30mon end
else 0
end
) * -1 as Encaissement,
sum ( g30mon ) * -1 as SoldeADateArrete
from agirab1.g30hlo0
inner join simco.bx_FGironDatArr DatArr
on c04ade * 10000 + c04mde * 100 + c04jde <= DateArrete
group by d01ste, g10mdg, d03trs

) hlo
on mdg.d01ste = hlo.d01ste
and mdg.g10mdg = hlo.g10mdg
) bai
inner join simco.bx_FGironDatArr DatArr
on DateArrete > 0
left outer join
(
select d65rub, d65lib from fbase1.d65ftc0 where upper ( d64cod ) = 'GES'
) ftc
on g10ges = d65rub
left outer join agirab1.d01ste0 ste
on bai.d01ste = ste.d01ste
left outer join (
select d01ste, regionoperationnelle from agirab1.d01ste0
inner join simco.bx_ro
on upper ( activite ) = 'GER'
and upper ( departement ) = '1'
and d01ste = societe


union all

select d01ste, RegionOperationnelle from agirab1.d01ste0
inner join simco.bx_ro
on upper ( activite ) = 'GER'
and upper ( departement ) = '1'
where d01ste not in ( select d01ste from agirab1.d01ste0 inner join simco.bx_ro on upper ( departement ) = '1' and d01ste = societe )
and societe = ''
) ro
on bai.d01ste = ro.d01ste
order by bai.d01ste, g10mdg, d03trs;


Merci pour votre réponse
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/08/2011, 11h41   #4
Membre actif
 
Avatar de sofiane_bfm007
 
Consultant Décisionnel
Inscription : mai 2008
Messages : 261
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : Consultant Décisionnel

Informations forums :
Inscription : mai 2008
Messages : 261
Points : 187
Points : 187
Envoyer un message via MSN à sofiane_bfm007
Essaie avec cela :

Code :
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
"select
'1' As Departement, RegionOperationnelle as NomDepartement,
bai.d01ste as societe, d01rs1 as NomSociete,
g10mdg as Mandat,
d30nm1 as NomImmeuble,
g10ges as Gestionnaire,
d65lib as NomGestionnaire,
d03trs as Locataire,
SoldeAvantTrimestre,
Encaissement,
case when Encaissement > 0
then
case when SoldeAvantTrimestre >= 0
then 0
else
case when Encaissement + SoldeAvantTrimestre <= 0 then Encaissement else SoldeAvantTrimestre * -1 end
end
else 0
end as EncaissementPourCompenserDebit,
SoldeADateArrete,
Quittancement,
case when Encaissement = 0
then 0
else
case when Quittancement = 0
then 1
else
case when abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / Quittancement ) > 1
then abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / Quittancement )
else abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / Quittancement )
end
end
end as TauxEncaissementInstantane,
case when SoldeAvantTrimestre + Quittancement = 0
then 1
else
case when abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantTrimestre + Quittancement ) ) > 1
then abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantTrimestre + Quittancement ) )
else abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantTrimestre + Quittancement ) )
end
end as TauxEncaissementCumule,
substring ( cast ( DebutPeriode as char ( 8 ) ) , 7 , 2 ) || '/' ||
substring ( cast ( DebutPeriode as char ( 8 ) ) , 5 , 2 ) || '/' ||
substring ( cast ( DebutPeriode as char ( 8 ) ) , 1 , 4 )
as DebutPeriode,
substring ( cast ( DateArrete as char ( 8 ) ) , 7 , 2 ) || '/' || substring ( cast ( DateArrete as char ( 8 ) ) , 5 , 2 ) || '/' || substring ( cast ( DateArrete as char ( 8 ) ) , 1 , 4 ) as DateArrete,
substring ( cast ( 100 + day ( current date ) as char ( 3 ) ) , 2 , 2 ) || '/' ||
substring ( cast ( 100 + month ( current date ) as char ( 3 ) ) , 2 , 2 ) || '/' ||
cast ( year ( current date ) as char ( 4 ) )
as DateTraitement
from
(
select
mdg.d01ste, mdg.g10mdg, d30nm1, g10ges, d03trs,
case when SoldeAvantTrimestre is null then 0 else SoldeAvantTrimestre end as SoldeAvantTrimestre,
case when Quittancement is null then 0 else Quittancement end as Quittancement,
case when Encaissement is null then 0 else Encaissement end as Encaissement,
case when SoldeADateArrete is null then 0 else SoldeADateArrete end as SoldeADateArrete
from
(
select d01ste, g10mdg, d30nm1, g10ges
from fbase1.g10mdg0
inner join simco.bx_FGironDatArr DatArr
on g10agd * 10000 + g10mgd * 100 + g10jgd <= DateArrete
and ( g10agf = 0 or g10agf * 10000 + g10mgf * 100 + g10jgf >= DateArrete )
) mdg
left outer join
(
select d01ste, g10mdg, d03trs,
sum ( case when c04ade * 10000 + c04mde * 100 + c04jde < DebutPeriode then g30mon else 0 end ) * -1 as SoldeAvantTrimestre,
sum (
case when
 
(
( select count ( * ) from simco.bx_ro where departement = 'VB' ) = 0
and c04ade * 10000 + c04mde * 100 + c04jde >= DebutPeriode
)
or
 
(
( select count ( * ) from simco.bx_ro where departement = 'VB' ) > 0
and c04ade * 10000 + c04mde * 100 + c04jde between DebutPeriode and FinPeriode
)
then
case when g30mon > 0 then g30mon else 0 end
else 0
end
) * -1 as Quittancement,
sum (
case when c04ade * 10000 + c04mde * 100 + c04jde >= DebutPeriode
then
case when g30mon > 0 then 0 else g30mon end
else 0
end
) * -1 as Encaissement,
sum ( g30mon ) * -1 as SoldeADateArrete
from agirab1.g30hlo0
inner join simco.bx_FGironDatArr DatArr
on c04ade * 10000 + c04mde * 100 + c04jde <= DateArrete
group by d01ste, g10mdg, d03trs
 
) hlo
on mdg.d01ste = hlo.d01ste
and mdg.g10mdg = hlo.g10mdg
) bai
inner join simco.bx_FGironDatArr DatArr
on DateArrete > 0
left outer join
(
select d65rub, d65lib from fbase1.d65ftc0 where upper ( d64cod ) = 'GES'
) ftc
on g10ges = d65rub
left outer join agirab1.d01ste0 ste
on bai.d01ste = ste.d01ste
left outer join (
select d01ste, regionoperationnelle from agirab1.d01ste0
inner join simco.bx_ro
on upper ( activite ) = 'GER'
and upper ( departement ) = '1'
and d01ste = societe
 
 
union all
 
select d01ste, RegionOperationnelle from agirab1.d01ste0
inner join simco.bx_ro
on upper ( activite ) = 'GER'
and upper ( departement ) = '1'
where d01ste not in ( select d01ste from agirab1.d01ste0 inner join simco.bx_ro on upper ( departement ) = '1' and d01ste = societe )
and societe = ''
) ro
on bai.d01ste = ro.d01ste
order by bai.d01ste, g10mdg, d03trs"
__________________
Business Intelligence : Talend, Cognos 8, SAS 9.2, ODI
sofiane_bfm007 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/08/2011, 12h07   #5
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
ça marche maintenant, je vous remercie, mais qu'est ce que vous avez changé.
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/08/2011, 12h57   #6
Membre actif
 
Avatar de sofiane_bfm007
 
Consultant Décisionnel
Inscription : mai 2008
Messages : 261
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : Consultant Décisionnel

Informations forums :
Inscription : mai 2008
Messages : 261
Points : 187
Points : 187
Envoyer un message via MSN à sofiane_bfm007
De rien

J'ai enlevé la virgule et encadré la requête par double quotes " ma requête "
__________________
Business Intelligence : Talend, Cognos 8, SAS 9.2, ODI
sofiane_bfm007 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/08/2011, 13h45   #7
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
Le problème persiste je pense que c'est autre chose, mais je ne sais pas.
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/08/2011, 14h20   #8
Membre Expert
 
Avatar de haskouse
 
Homme Mustapha EL HASSAK
Ingénieur développement logiciels
Inscription : août 2009
Messages : 627
Détails du profil
Informations personnelles :
Nom : Homme Mustapha EL HASSAK
Âge : 26
Localisation : Maroc

Informations professionnelles :
Activité : Ingénieur développement logiciels
Secteur : Finance

Informations forums :
Inscription : août 2009
Messages : 627
Points : 1 514
Points : 1 514
C'est quoi le problème cette fois-ci ?
Essai de reposter la requête et pourquoi pas une capture du job.
__________________
Le savant qui enseigne le bien aux gens et ne le met pas en pratique, est semblable à la torche qui éclaire en se brûlant. "Mohammed le Messager d’Allah" (que la paix et le salut d'Allah soient sur lui)

Mes articles publiés
haskouse est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/09/2011, 15h02   #9
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
Je trouve pas la solution ça marche maintenant, mais une instruction pareille dans un autre job affiche l'erreur: Elément syntaxique <FIN-INSTRUCTION> n'est pas correct. Eléments possibles : ( + - ? : DAY INF NAN RID ROW RRN
comment ça fin instruction n'est pas correcte
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/09/2011, 15h42   #10
Membre Expert
 
Avatar de haskouse
 
Homme Mustapha EL HASSAK
Ingénieur développement logiciels
Inscription : août 2009
Messages : 627
Détails du profil
Informations personnelles :
Nom : Homme Mustapha EL HASSAK
Âge : 26
Localisation : Maroc

Informations professionnelles :
Activité : Ingénieur développement logiciels
Secteur : Finance

Informations forums :
Inscription : août 2009
Messages : 627
Points : 1 514
Points : 1 514
En fait il s'agit d'une erreur dans la syntaxe de ta requête.
Si tu peux poster la requête ce serait bien.

Citation:
... mais une instruction pareille dans un autre job affiche l'erreur ...
Essai de comparer les requêtes peut être qu'il y a une erreur qui s'est glissée quelque part.
__________________
Le savant qui enseigne le bien aux gens et ne le met pas en pratique, est semblable à la torche qui éclaire en se brûlant. "Mohammed le Messager d’Allah" (que la paix et le salut d'Allah soient sur lui)

Mes articles publiés
haskouse est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/09/2011, 10h27   #11
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
Voila la requête, aidez moi s'ils vous plait.

"
select
RegionOperationnelle, ' "+ ((String)globalMap.get("dep"))+" ' As Departement,
mvt.d01ste as Societe, d01rs1 as NomSociete,
c04man as Mandat,
SoldeAvantDateValidation,
Encaissement,
case when Encaissement > 0 then
case when SoldeAvantDateValidation >= 0 then 0 else
case when Encaissement + SoldeAvantDateValidation <= 0 then Encaissement else
SoldeAvantDateValidation * -1 end end
else 0 end as EncaissementPourCompenserDebit,
SoldeADateTraitement,
AppelDeFonds,

case when Encaissement = 0
then 0
else
case when AppelDeFonds = 0
then 1
else
case when abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / AppelDeFonds ) > 1
then abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / AppelDeFonds )
else abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / AppelDeFonds )
end
end
end as TauxEncaissementInstantane,
case when SoldeAvantDateValidation + AppelDeFonds = 0
then 1
else
case when abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantDateValidation +
AppelDeFonds ) ) > 1
then abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantDateValidation +
AppelDeFonds ) )
end
end as TauxEncaissementCumule,
substring ( DateComptabilisation , 7 , 2 ) || '/' || substring ( DateComptabilisation , 5 ,
2 ) || '/' || substring ( DateComptabilisation , 1 , 4 ) as DateComptabilisation,
substring ( cast ( current date as char ( 10 ) ) , 9 , 2 ) || '/' ||
substring ( cast ( current date as char ( 10 ) ) , 6 , 2 ) || '/' ||
substring ( cast ( current date as char ( 10 ) ) , 1 , 4 ) as DateTraitement
from (
select mvt.d01ste, c04man, hsv.DateValidation, hsv.DateComptabilisation,
sum ( case when mvt.DateComptabilisation < hsv.DateValidation then c04mon else 0 end ) * -1 as
SoldeAvantDateValidation,
sum ( case when mvt.DateComptabilisation >= hsv.DateValidation then Encaissement else 0 end ) as
Encaissement,
sum ( case when mvt.DateComptabilisation <= year ( current date ) * 10000 + month ( current date )
* 100 + day ( current date ) then c04mon else 0 end ) * -1
as SoldeADateTraitement,
sum ( case when mvt.DateComptabilisation = hsv.DateComptabilisation then AppelDeFonds else 0 end )
as AppelDeFonds
from (
select d01ste, c04man, c01cpt, c04scp, c04blc,
c04ade * 10000 + C04mde * 100 + c04jde as DateComptabilisation,
sum ( case when c04mon < 0 then c04mon else 0 end ) * -1 as Encaissement,
sum ( case when c04mon > 0 then c04mon else 0 end ) * -1 as AppelDeFonds,
sum ( c04mon ) as c04mon from agircp"+ ((String)globalMap.get("dep"))+".c04mvt0 mvt
where c01cpt = 450100
group by d01ste, c04man, c01cpt, c04scp, c04blc, c04ade * 10000 + C04mde * 100 + c04jde ) mvt
inner join (
select d01ste, s10man, S90cpt,
min ( s91adv * 10000 + s91mdv * 100 + s91jdv ) as DateValidation,
s90acp * 10000 + s90mcp * 100 + s90jcp as DateComptabilisation,
sum ( s91mre ) as s91mre
from agircp"+ ((String)globalMap.get("dep"))+".s91hsv0 hsv
where s90cpt = 450100 and s90acp * 10000 + s90mcp * 100 + s90jcp = 20110701
group by d01ste, s10man, s90cpt, s90jcp, s90mcp, s90acp ) hsv
on mvt.d01ste = hsv.d01ste and mvt.c04man = hsv.s10man and mvt.c01cpt = hsv.s90cpt
and mvt.DateComptabilisation <= ( case when year ( current date ) * 10000 + month ( current date ) * 100 + day ( current date ) < 20110701
then 99999999
else year ( current date ) * 10000 + month ( current date ) * 100 + day ( current date ) end )
group by mvt.d01ste, c04man, hsv.DateComptabilisation, hsv.DateValidation ) mvt
left outer join (
select d01ste, regionoperationnelle from agircp"+ ((String)globalMap.get("dep"))+".d01ste0
inner join simco.bx_ro
on upper ( activite ) = 'COP'
and upper ( departement ) = ' "+ ((String)globalMap.get("dep"))+" '
and d01ste = societe
union all
select d01ste, regionoperationnelle from agircp"+ ((String)globalMap.get("dep"))+".d01ste0
inner join simco.bx_ro
on upper ( activite ) = 'COP'
and upper ( departement ) = ' "+ ((String)globalMap.get("dep"))+" '
where d01ste not in ( select d01ste from agircp"+ ((String)globalMap.get("dep"))+".d01ste0 inner
join simco.bx_ro on upper ( departement ) = ' "+ ((String)globalMap.get("dep"))+" ' and d01ste = societe ) and societe = '' ) ro
on mvt.d01ste = ro.d01ste
left outer join ( agircp"+ ((String)globalMap.get("dep"))+".d01ste0 ste on mvt.d01ste = ste.d01ste )
order by RegionOperationnelle, departement , mvt.d01ste

"
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/09/2011, 10h41   #12
Membre Expert
 
Avatar de haskouse
 
Homme Mustapha EL HASSAK
Ingénieur développement logiciels
Inscription : août 2009
Messages : 627
Détails du profil
Informations personnelles :
Nom : Homme Mustapha EL HASSAK
Âge : 26
Localisation : Maroc

Informations professionnelles :
Activité : Ingénieur développement logiciels
Secteur : Finance

Informations forums :
Inscription : août 2009
Messages : 627
Points : 1 514
Points : 1 514
Salut,

Bon c'est un peu difficile de t'aider sur cette requête sans avoir la base pour faire un test. Sinon on ne perd pas éspoir quand même

J'ai remarqué que tu récupères une variable depuis le globalMap pour la mettre dans ta requête :

Code :
((String)globalMap.get("dep"))
La première chose à faire c'est de t'assurer que la variable contient belle et bien une valeur, et surtout la bonne valeur.

Deuxièmement, j'ai supposé que ta variable contient la valeur "toto" et j'ai remplacé dans ta requête, ça me donne ceci :

Code :
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
SELECT RegionOperationnelle,
       ' toto ' AS Departement,
       mvt.d01ste AS Societe,
       d01rs1 AS NomSociete,
       c04man AS Mandat,
       SoldeAvantDateValidation,
       Encaissement,
       case
         when Encaissement > 0 then
          case
         when SoldeAvantDateValidation >= 0 then
          0
         else
          case
         when Encaissement + SoldeAvantDateValidation <= 0 then
          Encaissement
         else
          SoldeAvantDateValidation * -1
       end end else 0 end AS EncaissementPourCompenserDebit,
       SoldeADateTraitement,
       AppelDeFonds,
 
       case
         when Encaissement = 0 then
          0
         else
          case
         when AppelDeFonds = 0 then
          1
         else
          case
         when abs((1230.456789 + Encaissement - 1230.456789) / AppelDeFonds) > 1 then
          abs((1230.456789 + Encaissement - 1230.456789) / AppelDeFonds)
         else
          abs((1230.456789 + Encaissement - 1230.456789) / AppelDeFonds)
       end end end AS TauxEncaissementInstantane,
       case
         when SoldeAvantDateValidation + AppelDeFonds = 0 then
          1
         else
          case
         when abs((1230.456789 + Encaissement - 1230.456789) /
                  (SoldeAvantDateValidation + AppelDeFonds)) > 1 then
          abs((1230.456789 + Encaissement - 1230.456789) /
              (SoldeAvantDateValidation + AppelDeFonds))
       end end AS TauxEncaissementCumule,
       substring(DateComptabilisation, 7, 2) || '/' ||
       substring(DateComptabilisation, 5, 2) || '/' ||
       substring(DateComptabilisation, 1, 4) AS DateComptabilisation,
       substring(cast(current date AS char(10)), 9, 2) || '/' ||
       substring(cast(current date AS char(10)), 6, 2) || '/' ||
       substring(cast(current date AS char(10)), 1, 4) AS DateTraitement
  FROM (SELECT mvt.d01ste,
               c04man,
               hsv.DateValidation,
               hsv.DateComptabilisation,
               sum(case
                     when mvt.DateComptabilisation < hsv.DateValidation then
                      c04mon
                     else
                      0
                   end) * -1 AS SoldeAvantDateValidation,
               sum(case
                     when mvt.DateComptabilisation >= hsv.DateValidation then
                      Encaissement
                     else
                      0
                   end) AS Encaissement,
               sum(case
                     when mvt.DateComptabilisation <=
                          year(current date) * 10000 + month(current date) * 100 +
                          day(current date) then
                      c04mon
                     else
                      0
                   end) * -1 AS SoldeADateTraitement,
               sum(case
                     when mvt.DateComptabilisation = hsv.DateComptabilisation then
                      AppelDeFonds
                     else
                      0
                   end) AS AppelDeFonds
          FROM (SELECT d01ste,
                       c04man,
                       c01cpt,
                       c04scp,
                       c04blc,
                       c04ade * 10000 + C04mde * 100 + c04jde AS DateComptabilisation,
                       sum(case
                             when c04mon < 0 then
                              c04mon
                             else
                              0
                           end) * -1 AS Encaissement,
                       sum(case
                             when c04mon > 0 then
                              c04mon
                             else
                              0
                           end) * -1 AS AppelDeFonds,
                       sum(c04mon) AS c04mon
                  FROM agircptoto.c04mvt0 mvt
                 WHERE c01cpt = 450100
                 GROUP BY d01ste,
                          c04man,
                          c01cpt,
                          c04scp,
                          c04blc,
                          c04ade * 10000 + C04mde * 100 + c04jde) mvt
         INNER JOIN (SELECT d01ste,
                           s10man,
                           S90cpt,
                           min(s91adv * 10000 + s91mdv * 100 + s91jdv) AS DateValidation,
                           s90acp * 10000 + s90mcp * 100 + s90jcp AS DateComptabilisation,
                           sum(s91mre) AS s91mre
                      FROM agircptoto.s91hsv0 hsv
                     WHERE s90cpt = 450100
                       AND s90acp * 10000 + s90mcp * 100 + s90jcp = 20110701
                     GROUP BY d01ste, s10man, s90cpt, s90jcp, s90mcp, s90acp) hsv ON mvt.d01ste =
                                                                                     hsv.d01ste
                                                                                 AND mvt.c04man =
                                                                                     hsv.s10man
                                                                                 AND mvt.c01cpt =
                                                                                     hsv.s90cpt
                                                                                 AND mvt.DateComptabilisation <=
                                                                                     (case when
                                                                                      year(current date) *
                                                                                      10000 +
                                                                                      month(current date) * 100 +
                                                                                      day(current date) <
                                                                                      20110701 then
                                                                                      99999999 else
                                                                                      year(current date) *
                                                                                      10000 +
                                                                                      month(current date) * 100 +
                                                                                      day(current date) end)
         GROUP BY mvt.d01ste,
                  c04man,
                  hsv.DateComptabilisation,
                  hsv.DateValidation) mvt
  LEFT OUTER JOIN (SELECT d01ste, regionoperationnelle
                     FROM agircptoto.d01ste0
                    INNER JOIN simco.bx_ro ON upper(activite) = 'COP'
                                          AND upper(departement) = ' toto '
                                          AND d01ste = societe
                   union ALL
                   SELECT d01ste, regionoperationnelle
                     FROM agircptoto.d01ste0
                    INNER JOIN simco.bx_ro ON upper(activite) = 'COP'
                                          AND upper(departement) = ' toto '
                    WHERE d01ste NOT IN
                          (SELECT d01ste
                             FROM agircptoto.d01ste0
                            INNER JOIN simco.bx_ro ON upper(departement) =
                                                      ' toto '
                                                  AND d01ste = societe)
                      AND societe = '') ro ON mvt.d01ste = ro.d01ste
  LEFT OUTER JOIN(agircptoto.d01ste0 ste ON mvt.d01ste = ste.d01ste)
 ORDER BY RegionOperationnelle, departement, mvt.d01ste
J'ai utilisé un analyseur synatxique apparemment la syntaxe de ta requête est bonne à 100%, mais je te conseille de faire la même chose que moi, càd de remplacer ta varibale par une vraie valeur et de la tester sur ta base.

Essai ceci puis fais nous un retour !!

Bonne chance.
__________________
Le savant qui enseigne le bien aux gens et ne le met pas en pratique, est semblable à la torche qui éclaire en se brûlant. "Mohammed le Messager d’Allah" (que la paix et le salut d'Allah soient sur lui)

Mes articles publiés
haskouse est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/09/2011, 11h47   #13
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
ça donne ça
Exception in component tAS400Input_3
java.sql.SQLException: [SQL0199] Le mot clé ON est mal placé. Eléments possibles : FULL LEFT CROSS INNER RIGHT EXCEPTION.
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:650)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:621)
at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1518)
at com.ibm.as400.access.AS400JDBCStatement.executeQuery(AS400JDBCStatement.java:1949)
at alim_dwh_postgres.gerappel_loyer_0_1.gerappel_loyer.tAS400Input_2Process(gerappel_loyer.java:1097)
at alim_dwh_postgres.gerappel_loyer_0_1.gerappel_loyer.runJobInTOS(gerappel_loyer.java:3043)
at alim_dwh_postgres.gerappel_loyer_0_1.gerappel_loyer.main(gerappel_loyer.java:2903)
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/09/2011, 12h07   #14
Membre Expert
 
Avatar de haskouse
 
Homme Mustapha EL HASSAK
Ingénieur développement logiciels
Inscription : août 2009
Messages : 627
Détails du profil
Informations personnelles :
Nom : Homme Mustapha EL HASSAK
Âge : 26
Localisation : Maroc

Informations professionnelles :
Activité : Ingénieur développement logiciels
Secteur : Finance

Informations forums :
Inscription : août 2009
Messages : 627
Points : 1 514
Points : 1 514
Il faut être un peu plus clair.
Dis moi d'abord qu'est ce que tu as fait comme manipulation pour avoir eu cette exception ??

Autre chose, test ta requête directement sur l'AS400 pour voir ce que ça donne ?
__________________
Le savant qui enseigne le bien aux gens et ne le met pas en pratique, est semblable à la torche qui éclaire en se brûlant. "Mohammed le Messager d’Allah" (que la paix et le salut d'Allah soient sur lui)

Mes articles publiés
haskouse est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/09/2011, 15h05   #15
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
c'est une requête d'un reporting exécutée sur une BDD AS400 qui fonctionne très bien, mais avec talend il affiche une erreur de fin d'instruction, c'est vrai c'est un peu compliqué mais c'est correcte, je vous remercie pour votre patience.
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/09/2011, 15h38   #16
Membre Expert
 
Avatar de haskouse
 
Homme Mustapha EL HASSAK
Ingénieur développement logiciels
Inscription : août 2009
Messages : 627
Détails du profil
Informations personnelles :
Nom : Homme Mustapha EL HASSAK
Âge : 26
Localisation : Maroc

Informations professionnelles :
Activité : Ingénieur développement logiciels
Secteur : Finance

Informations forums :
Inscription : août 2009
Messages : 627
Points : 1 514
Points : 1 514
Il y'a surement une erreur de syntaxe qui s'est glissée quelque part, essai avec ça :

Code :
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
"
select 
RegionOperationnelle, ' "+ ((String)globalMap.get("dep"))+" ' As Departement,
mvt.d01ste as Societe, d01rs1 as NomSociete,
c04man as Mandat,
SoldeAvantDateValidation,
Encaissement,
case when Encaissement > 0 then
case when SoldeAvantDateValidation >= 0 then 0 else
case when Encaissement + SoldeAvantDateValidation <= 0 then Encaissement else 
SoldeAvantDateValidation * -1 end end
else 0 end as EncaissementPourCompenserDebit,
SoldeADateTraitement,
AppelDeFonds,
 
case when Encaissement = 0
then 0
else
  case when AppelDeFonds = 0
  then 1
  else
    case when abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / AppelDeFonds ) > 1
    then abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / AppelDeFonds )     
    else abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / AppelDeFonds )
    end
  end
end as TauxEncaissementInstantane,
case when SoldeAvantDateValidation + AppelDeFonds = 0
then 1
else
  case when abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantDateValidation + 
AppelDeFonds ) ) > 1
  then abs ( ( 1230.456789 + Encaissement - 1230.456789 ) / ( SoldeAvantDateValidation + 
AppelDeFonds ) )     
    end
end as TauxEncaissementCumule,
substring ( DateComptabilisation , 7 , 2 ) || '/' || substring ( DateComptabilisation , 5 ,
 2 ) || '/' || substring ( DateComptabilisation , 1 , 4 ) as DateComptabilisation,
substring ( cast ( current date as char ( 10 ) ) , 9 , 2 ) || '/' ||
substring ( cast ( current date as char ( 10 ) ) , 6 , 2 ) || '/' ||
substring ( cast ( current date as char ( 10 ) ) , 1 , 4 ) as DateTraitement
from (
select mvt.d01ste, c04man, hsv.DateValidation, hsv.DateComptabilisation,
sum ( case when mvt.DateComptabilisation < hsv.DateValidation then c04mon else 0 end ) * -1 as 
SoldeAvantDateValidation,
sum ( case when mvt.DateComptabilisation >= hsv.DateValidation then Encaissement else 0 end ) as 
Encaissement,
sum ( case when mvt.DateComptabilisation <= year ( current date ) * 10000 + month ( current date ) 
* 100 + day ( current date ) then c04mon else 0 end ) * -1
as SoldeADateTraitement,
sum ( case when mvt.DateComptabilisation = hsv.DateComptabilisation then AppelDeFonds else 0 end ) 
as AppelDeFonds
from (
select d01ste, c04man, c01cpt, c04scp, c04blc,
 c04ade * 10000 + C04mde * 100 + c04jde as DateComptabilisation,
sum ( case when c04mon < 0 then c04mon else 0 end ) * -1 as Encaissement, 
sum ( case when c04mon > 0 then c04mon else 0 end ) * -1 as AppelDeFonds,
sum ( c04mon ) as c04mon from agircp"+ ((String)globalMap.get("dep"))+".c04mvt0 mvt
where c01cpt = 450100
group by d01ste, c04man, c01cpt, c04scp, c04blc, c04ade * 10000 + C04mde * 100 + c04jde ) mvt
inner join (
select d01ste, s10man, S90cpt,
min ( s91adv * 10000 + s91mdv * 100 + s91jdv ) as DateValidation,
s90acp * 10000 + s90mcp * 100 + s90jcp as DateComptabilisation,
sum ( s91mre ) as s91mre
from agircp"+ ((String)globalMap.get("dep"))+".s91hsv0 hsv
where s90cpt = 450100 and s90acp * 10000 + s90mcp * 100 + s90jcp = 20110701
group by d01ste, s10man, s90cpt, s90jcp, s90mcp, s90acp ) hsv
on mvt.d01ste = hsv.d01ste and mvt.c04man = hsv.s10man and mvt.c01cpt = hsv.s90cpt
and mvt.DateComptabilisation <= (   case when year ( current date ) *  10000 + month ( current date ) * 100 + day ( current date ) <  20110701
  then 99999999 
  else year ( current date ) * 10000 + month ( current date ) * 100 + day ( current date )   end )
group by mvt.d01ste, c04man, hsv.DateComptabilisation, hsv.DateValidation ) mvt
left outer join (
select d01ste, regionoperationnelle from agircp"+ ((String)globalMap.get("dep"))+".d01ste0
inner join simco.bx_ro
on upper ( activite ) = 'COP'
and upper ( departement ) = ' "+ ((String)globalMap.get("dep"))+" '
and d01ste = societe
union all
select d01ste, regionoperationnelle from agircp"+ ((String)globalMap.get("dep"))+".d01ste0
inner join simco.bx_ro
on upper ( activite ) = 'COP'
and upper ( departement ) = ' "+ ((String)globalMap.get("dep"))+" '
where d01ste not in ( select d01ste from agircp"+ ((String)globalMap.get("dep"))+".d01ste0 inner 
join simco.bx_ro on upper ( departement ) = ' "+ ((String)globalMap.get("dep"))+" ' and d01ste = societe ) and societe = '' ) ro
on mvt.d01ste = ro.d01ste
left outer join  agircp"+ ((String)globalMap.get("dep"))+".d01ste0 ste  on mvt.d01ste = ste.d01ste
order by RegionOperationnelle,  departement , mvt.d01ste
 
"
__________________
Le savant qui enseigne le bien aux gens et ne le met pas en pratique, est semblable à la torche qui éclaire en se brûlant. "Mohammed le Messager d’Allah" (que la paix et le salut d'Allah soient sur lui)

Mes articles publiés
haskouse est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/09/2011, 18h07   #17
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
ça a marché, vous avez quoi modifié ?
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/09/2011, 10h24   #18
Membre Expert
 
Avatar de haskouse
 
Homme Mustapha EL HASSAK
Ingénieur développement logiciels
Inscription : août 2009
Messages : 627
Détails du profil
Informations personnelles :
Nom : Homme Mustapha EL HASSAK
Âge : 26
Localisation : Maroc

Informations professionnelles :
Activité : Ingénieur développement logiciels
Secteur : Finance

Informations forums :
Inscription : août 2009
Messages : 627
Points : 1 514
Points : 1 514
J'ai modifié la ligne suivante :

Code :
LEFT OUTER JOIN(agircptoto.d01ste0 ste ON mvt.d01ste = ste.d01ste)
En la remplaçant par celle là :

Code :
LEFT OUTER JOIN agircptoto.d01ste0 ste ON mvt.d01ste = ste.d01ste
Si tu as remarqué la diffèrence, j'ai juste enlevé les deux parenthéses ouvrante puis fermante après le clause LEFT OUTER JOIN.

N'oublie pas le tag .

Bonne continuation.
__________________
Le savant qui enseigne le bien aux gens et ne le met pas en pratique, est semblable à la torche qui éclaire en se brûlant. "Mohammed le Messager d’Allah" (que la paix et le salut d'Allah soient sur lui)

Mes articles publiés
haskouse est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/09/2011, 15h32   #19
Futur Membre du Club
 
Inscription : juillet 2011
Messages : 99
Détails du profil
Informations forums :
Inscription : juillet 2011
Messages : 99
Points : 18
Points : 18
Merci c'est résolu
sinoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 14h37.


 
 
 
 
Partenaires

Hébergement Web