Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
andriuacevedo
Regular Visitor

Microsoft Db2 Client: SQLSTATE=22023 SQLCODE=-802 SQLSTATE=HY000 SQLCODE=-343

Instruccion SQL 

 

SELECT A.FECTRANTSL,A.NUMCTLTSL,A.NUMTERTSL ,A.NUMTRANTSL,A.NUMCORRDUP,A.NUMCORRDET,G.DIGTARJ,H.LINEOM,A.MARDESTSL,A.CANARTTSL,A.CANTIDDEV,A.PREUNITSL,A.TOTARTTSL,SUBSTRING(A.CODARTTSL,3,9),
A.DSCARTTSL,B.CCTRANTSL,C.RUTCLIENTE,C.NOMBRE,C.DIRECCION,C.CODREGION,C.CODCIUDAD,C.CODCOMUNA,C.GIRCOM,C.FONO,C.NOMREGION,C.NOMCIUDAD,C.NOMCOMUNA, D.TIPODOC,D.NUMDOCTSL,E.CODPAGOTSL,F.NUMDOCEOM,I.INUMBR AS SKU, I.IDEPT,DEP.DPTNAM, I.ISDEPT, SDE.DPTNAM, I.ICLAS, CLA.DPTNAM, I.ISCLAS, APZ.APZRTN , APA.AANAME,
I.IDESCR, ZIT.ITAVAL, IFNULL(COST.CBAVGC,I.IFCCST) AS CSTPROM, I.INUMBR AS SKU,I.ASNUM FROM SVALBUGD.SVVSF01 A
INNER JOIN SVALBUGD.SVVSF00 B ON
A.FECTRANTSL=B.FECTRANTSL AND
A.NUMCTLTSL=B.NUMCTLTSL AND
A.NUMTERTSL=B.NUMTERTSL AND
A.NUMTRANTSL=B.NUMTRANTSL
INNER JOIN SVTBBUGD.SVTBF29 G ON B.FECTRANTSL=G.FECTRANTSL AND
B.NUMCTLTSL=G.NUMCTLTSL AND
B.NUMTERTSL=G.NUMTERTSL AND
B.NUMTRANTSL=G.NUMTRANTSL
INNER JOIN SVALBUGD.SVVSFF7B C ON
B.FECTRANTSL= C.FECTRANTSL AND
B.NUMCTLTSL= C.NUMCTLTSL AND
B.NUMTERTSL = C.NUMTERTSL AND
B.NUMTRANTSL= C.NUMTRANTSL
INNER JOIN SVALBUGD.SVLVF28 D ON
B.FECTRANTSL= D.FECTRANTSL AND
B.NUMCTLTSL= D.NUMCTLTSL AND
B.NUMTERTSL = D.NUMTERTSL AND
B.NUMTRANTSL= D.NUMTRANTSL
INNER JOIN SVALBUGD.SVVSF02 E ON
B.FECTRANTSL= E.FECTRANTSL AND
B.NUMCTLTSL= E.NUMCTLTSL AND
B.NUMTERTSL = E.NUMTERTSL AND
B.NUMTRANTSL= E.NUMTRANTSL
LEFT JOIN SVALBUGD.SVLVF30 F ON
a.FECTRANTSL = F.FECTRANTSL AND
a.NUMCTLTSL = F.NUMCTLTSL AND
a.NUMTERTSL = F.NUMTERTSL AND
a.NUMTRANTSL = F.NUMTRANTSL AND
a.NUMCORRDUP = F.NUMCORRDUP
LEFT JOIN SVALBUGD.SVVSFF7A H ON
H.NSOLICITUD=F.NUMDOCEOM AND
H.NUMCORRDET=A.NUMCORRDET
INNER JOIN MMSP4LIB.INVMST I ON I.INUMBR = SUBSTRING(A.CODARTTSL,3,9)
INNER JOIN MMSP4LIB.INVCBL COST ON COST.INUMBR = I.INUMBR
INNER JOIN EXISBUGD.APADDR APA ON APA.AANUM = I.ASNUM
INNER JOIN EXISBUGD.APZRUT APZ ON APZ.APZVND = I.ASNUM
INNER JOIN MMSP4LIB.MSTZIT ZIT ON (ZIT.ISTYLÑ = I.ISTYLÑ AND ZIT.INUMBR = 0 AND ZIT.ITANAM = 'MARCA')
OR (ZIT.ISTYLÑ = '' AND ZIT.INUMBR = I.INUMBR AND ZIT.ITANAM = 'MARCA')
INNER JOIN EXISBUGD.INVDPT DEP ON DEP.IDEPT=I.IDEPT AND DEP.ISDEPT=0 AND DEP.ICLAS=0 AND DEP.ISCLAS=0
INNER JOIN EXISBUGD.INVDPT SDE ON SDE.IDEPT=I.IDEPT AND SDE.ISDEPT=I.ISDEPT AND SDE.ICLAS=0 AND SDE.ISCLAS=0
INNER JOIN EXISBUGD.INVDPT CLA ON CLA.IDEPT=I.IDEPT AND CLA.ISDEPT=I.ISDEPT AND CLA.ICLAS=I.ICLAS AND CLA.ISCLAS=0
WHERE B.FECTRANTSL >20230501 AND B.CCTRANTSL IN (1,2)
GROUP BY A.FECTRANTSL,A.NUMCTLTSL,A.NUMTERTSL ,A.NUMTRANTSL,A.NUMCORRDUP,A.NUMCORRDET,G.DIGTARJ,H.LINEOM,A.MARDESTSL,A.CANARTTSL,A.CANTIDDEV,A.PREUNITSL,A.TOTARTTSL,A.CODARTTSL,A.DSCARTTSL,
B.CCTRANTSL,C.RUTCLIENTE,C.NOMBRE,C.DIRECCION,C.CODREGION,C.CODCIUDAD,C.CODCOMUNA,C.GIRCOM,C.FONO,C.NOMREGION,C.NOMCIUDAD,C.NOMCOMUNA, D.TIPODOC,D.NUMDOCTSL,E.CODPAGOTSL,F.NUMDOCEOM,I.INUMBR,
I.IDEPT,DEP.DPTNAM, I.ISDEPT, SDE.DPTNAM, I.ICLAS, CLA.DPTNAM, I.ISCLAS, APZ.APZRTN , APA.AANAME,
I.IDESCR, ZIT.ITAVAL, COST.CBAVGC,I.IFCCST,I.INUMBR, I.ASNUM

 

Alguien que me ayude 😞

 

@Helpdesk 

 

 

0 REPLIES 0

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.