Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 11 Monaten, 3 Wochen
Letzter Beitrag:
vor 11 Monaten, 3 Wochen
Beteiligte Autoren:
Sivaprakash, Piet van Zanten, DerekT

[WD21][HFSQL21] Case in HFSQL Query

Startbeitrag von Sivaprakash am 09.06.2017 13:04


I need to write a case when ...... when .... Else End as part of the query. It's working fine in HFSQL Control centre, when I try to create the query in WD21 [through query editor] there seems to be no option to write a case syntax. I tried editing the query, it gives error message when I try to reverse engineer it.

I need to populate a table with 40 fields, creating a query string , executing it , assigning the result set to the table, through programming is a time consuming job. Is there any other easy way to get the work done ?

Happiness Always
BKR Sivaprakash



You can execute a text based SQL query using hExecuteSQLquery, check the Help.

Kind regards,

von Piet van Zanten - am 09.06.2017 13:30
Thanks Piet.

That's what I'm doing. If I could use a query file, it's easier for me, just assign that query in the content tab of description. No more codes.

To use hExecuteSQLquery, I need to set to Programming in the content tab, and manually add all those fields to query. It's a lengthy process, which I need to repeat for more windows. Is there any other better way to assign the resultset to table ?

Happiness Always
BKR Sivaprakash

von Sivaprakash - am 09.06.2017 13:42

Yes you can create an array of structures and do filetoarray
In the table description choose variable as datasource and choose the array. (must be global array)

Kind regards,

von Piet van Zanten - am 09.06.2017 13:51
You can add a CASE statement in the query editor if you prefer.

Bottom left you will see a button 'Calculated Item'.
Click will open another window.
You have a choice of using the supported SQL Statements or WLanguage functions.

von DerekT - am 09.06.2017 15:27
Thanks DerekT,

I could put Case sql statement now.

Happiness Always
BKR Sivaprakash

von Sivaprakash - am 10.06.2017 13:18
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.