Diese Seite mit anderen teilen ...

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

[WD21][HFSQL21] Case in HFSQL Query

Startbeitrag von Sivaprakash am 09.06.2017 13:04

Hello,

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

Antworten:

Hi,

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

Kind regards,
Piet

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
Hi,

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,
Piet

von Piet van Zanten - am 09.06.2017 13:51
Hi
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.