V
Vegeta_77
Guest
Progress-Procedure-Editor:
DEFINE STREAM myStream.
OUTPUT STREAM myStream TO 'C:\Temp\BelegAusgangSchnittstelle.txt'.
FOR EACH E_BelegAusgang
WHERE E_BelegAusgang.Firma = '000'
AND E_BelegAusgang.Schnittstelle = '$Standard'
NO-LOCK:
PUT STREAM myStream UNFORMATTED
STRING(E_BelegAusgang.Firma)
'|'
STRING(E_BelegAusgang.BelegNummer)
'|'
STRING(E_BelegAusgang.Schnittstelle)
'|'
SKIP
.
END.
I get this (extraction):
Firma | BelegNr | Schnittstelle
000 | 3 | $Standard
000 | 3 | $Standard
000 | 3 | $Standard
000 | 3 | $Standard
000 | 3 | $Standard
000 | 8 | $Standard
000 | 8 | $Standard
What I need is to COUNT the BelegNr. So I import the data of the TXT to SQL Server.
On Server my query is:
SELECT [BelegNr]
,COUNT(*) AS [Anzahl]
FROM [TestDB].[dbo].[Beleg_Ausgang]
GROUP BY [BelegNr]
ORDER BY [Anzahl]
With that query I got (extraction):
BelegNr Anzahl
3 | 5
8 | 2
Is there a way to put the COUNT directly into the Progress-Code? I mean, I want my result directly from the Progress-Procedure-Editor.
Continue reading...
DEFINE STREAM myStream.
OUTPUT STREAM myStream TO 'C:\Temp\BelegAusgangSchnittstelle.txt'.
FOR EACH E_BelegAusgang
WHERE E_BelegAusgang.Firma = '000'
AND E_BelegAusgang.Schnittstelle = '$Standard'
NO-LOCK:
PUT STREAM myStream UNFORMATTED
STRING(E_BelegAusgang.Firma)
'|'
STRING(E_BelegAusgang.BelegNummer)
'|'
STRING(E_BelegAusgang.Schnittstelle)
'|'
SKIP
.
END.
I get this (extraction):
Firma | BelegNr | Schnittstelle
000 | 3 | $Standard
000 | 3 | $Standard
000 | 3 | $Standard
000 | 3 | $Standard
000 | 3 | $Standard
000 | 8 | $Standard
000 | 8 | $Standard
What I need is to COUNT the BelegNr. So I import the data of the TXT to SQL Server.
On Server my query is:
SELECT [BelegNr]
,COUNT(*) AS [Anzahl]
FROM [TestDB].[dbo].[Beleg_Ausgang]
GROUP BY [BelegNr]
ORDER BY [Anzahl]
With that query I got (extraction):
BelegNr Anzahl
3 | 5
8 | 2
Is there a way to put the COUNT directly into the Progress-Code? I mean, I want my result directly from the Progress-Procedure-Editor.
Continue reading...