Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
MZein
Contributor III
Contributor III

SQL Query

Hi Friends 

I have the below query it work inside DBeaver but in Talend (component tOraclerowInput) it thows the exception  table out of index 

query is 

MERGE INTO PROTEE.T_HISTO_PRODUCTION_AGENT CIBLE
USING (SELECT RUGS.RO_ORGANISME_ID RUG_SOURCE, RUGC.RO_ORGANISME_ID RUG_CIBLE,
RAGS.RA_AGENT_ID,
HPA.RO_SOCIETE,
THPA_NUM_MISSION_PROD,
THPA_EXERCICE,
THPA_MNT_PRODUCTION,
THPA_NBR_VAC_REALISEES
FROM PROTEE.T_HISTO_PRODUCTION_AGENT HPA, PROTEE.R_ORGANISME RUGS, PROTEE.R_ORGANISME RUGC, PROTEE.R_AGENT RAGS
WHERE RUGS.RO_TE_ORGANISME = 'U' AND RUGS.RO_CODE_ORGANISME = 'AMOB1' -- UG source
AND RUGC.RO_TYPE_ORGANISME = 'U' AND RUGC.RO_CODE_ORGANISME = 'COOL1' -- UG cible
AND RAGS.RO_SOCIETE =5242 AND RAGS.RA_MATRICULE = 821525
AND RO_UG = RUGS.RO_ORGANISME_ID
AND HPA.RA_AGENT_ID = RAGS.RA_AGENT_ID
AND THPA_EXERCICE < to_char(sysdate, 'YYYY') )
SOURCE ON ( CIBLE.RO_UG = SOURCE.RUG_CIBLE
AND CIBLE.RA_AGENT_ID = SOURCE.RA_AGENT_ID
AND CIBLE.RO_SOCIETE = SOURCE.RO_SOCIETE
AND CIBLE.THPA_NUM_MISSION_PROD = SOURCE.THPA_NUM_MISSION_PROD
AND CIBLE.THPA_EXERCICE = SOURCE.THPA_EXERCICE)
WHEN MATCHED
THEN
UPDATE SET
CIBLE.THPA_MNT_PRODUCTION = CIBLE.THPA_MNT_PRODUCTION + SOURCE.THPA_MNT_PRODUCTION,
CIBLE.THPA_NBR_VAC_REALISEES = CIBLE.THPA_NBR_VAC_REALISEES + SOURCE.THPA_NBR_VAC_REALISEES
WHEN NOT MATCHED
THEN
INSERT (CIBLE.RO_UG,
CIBLE.RA_AGENT_ID,
CIBLE.RO_SOCIETE,
CIBLE.THPA_NUM_MISSION_PROD,
CIBLE.THPA_EXERCICE,
CIBLE.THPA_MNT_PRODUCTION,
CIBLE.THPA_NBR_VAC_REALISEES)
VALUES (SOURCE.RUG_CIBLE,
SOURCE.RA_AGENT_ID,
SOURCE.RO_SOCIETE,
SOURCE.THPA_NUM_MISSION_PROD,
SOURCE.THPA_EXERCICE,
SOURCE.THPA_MNT_PRODUCTION,
SOURCE.THPA_NBR_VAC_REALISEES)

 

Best regards

Labels (2)
3 Replies
vapukov
Master II
Master II

Hi

 

  • which exactly component do you use? (there no component tOraclerowInput, only tOracleRow or tOracleInput)
  • what exactly error code?

regards, Vlad

manodwhb
Champion II
Champion II

@MZein , you need to use tDBRow component to execute that query .

 

 

MZein
Contributor III
Contributor III
Author

Hi all

Thank you very much for your replies and I highly appreciate your interaction. I found the error. It is raised because i use tConnection component and I did some processing (read from csv file check data ) then I use the component tOracleRow. but When I use tconnection then tOracleRow the job run smoothly without error

Regards