Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 3 Jahren, 7 Monaten
Letzter Beitrag:
vor 3 Jahren, 7 Monaten
Beteiligte Autoren:
mat, Joris

[WD15] HFCS SQL issue

Startbeitrag von mat am 15.11.2014 17:39

Hello

I'm migrating a HF Classic application towards HF Cllient/Server and have had several problems with SQL code running in Classic but not HFCS. I can't find a solution for following query, which runs perfectly in HF Classic but not in HFCS. The error message "Report file is not in the FROM clause", doesen't make sense to me. Anyboday having any idea? Thanks.
Mat

Antworten:

sorry, forgot to add the query....

SELECT
Report.IDReport AS IDReport,
Report.ReportType AS ReportType,
Report.ShortName AS ShortName,
Report.IsCustom AS IsCustom,
Report.WindowName AS WindowName,
Report.IsActive AS IsActive,
Report.ReportName AS FileName,
Report.Destination AS Destination,
ReportML.Report AS RepName,
ReportML.IDLanguage AS IDLanguage
FROM
Report LEFT OUTER JOIN ReportML ON (Report.IDReport = ReportML.IDReport)
WHERE
(
Report.IsActive = 1
AND Report.WindowName = 'winProcessing'
AND Report.ReportType IN ('PROCESSING', 'STOCK TRANSACTION', 'STOCK CHECK LIST')
AND ReportML.IDLanguage = 0
)
UNION
SELECT
Report_Samil.IDReport AS IDReport,
Report_Samil.ReportType AS ReportType,
Report_Samil.ShortName AS ShortName,
Report_Samil.IsCustom AS IsCustom,
Report_Samil.WindowName AS WindowName,
Report_Samil.IsActive AS IsActive,
Report_Samil.ReportName AS FileName,
Report_Samil.Destination AS Destination,
ReportML_Samil.Report AS RepName,
ReportML_Samil.IDLanguage AS IDLanguage
FROM
Report_Samil Left OUTER JOIN ReportML_Samil on (Report_Samil.IDReport = ReportML_Samil.IDReport )
WHERE
(
Report_Samil.IsActive = 1
AND Report_Samil.WindowName = 'winProcessing'
AND Report_Samil.ReportType IN ('PROCESSING', 'STOCK TRANSACTION', 'STOCK CHECK LIST')
AND ReportML_Samil.IDLanguage = 0
)
ORDER by RepName Asc

von mat - am 15.11.2014 17:42
No point wasting more time over yet another inconsistency in the HF query engine. Maybe the reason is that the second set of files is defined via hDeclareExternal, though they are found by HFileExist. The two queries work OK when run independently.in HFCS.

I chose workaround by adding the result of the second query to the first.

Mat


IF NOT HExecuteSQLQuery(dsReport2,sQuery) THEN
Info(HErrorInfo) ; RESULT False
END
FOR ALL dsReport2
HCopyRecord(dsReport,dsReport2)
HAdd(dsReport)
END


von mat - am 15.11.2014 23:12
Hi,

Do you really need to use version 15 of the HFCS database? I once had the same kind of
issue with version 15 of the HFCS database. The problem disappeared just by updating the database to version 17 or later.

Kind regards,

Joris.

von Joris - am 17.11.2014 08:58
thanks Joris, I did upgrade and check the server version 19 before posting. Also, I have other UNION queries that work alright in HFCS. What beats me is that these queries are simple and both work alright when being run independently.

Mat

von mat - am 17.11.2014 13:46
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.