Manually edit SQL in Wappler?

I am a long time DW user, and have been using Web Assist extensions. I have looked at DMX Zone extensions in the past and really liked the look of them. But a dealbreaker in the past was the inability to manually edit SQL queries.

Is this now possible using Wappler? If it is, I would seriously consider switching to Wappler.

There is absolutely no need to edit manually SQL in Wappler as its visual Query Builder can handle almost anything in a much more easier and visual way.

Thanks George. I looked at it before and really liked it, but I think there were a couple of things I couldn’t do.

Is it possible to use the Query Builder to build out something like this:

CASE
WHEN AY_rank=1 THEN 5
WHEN AY_rank=2 THEN 4
WHEN AY_rank=3 THEN 3
WHEN AY_rank=4 THEN 2
WHEN AY_rank=5 THEN 1
ELSE 0 END AS AY_score

This is usually easy done client side with the Data Formatter.

You really shouldn’t do this server side. Server Side is just for querying data. Raw data.

When displayed to the user you can apply all kind of formatting you need. That is why we also have a rich set of formatting options.

2 Likes

Ok, I get you - so just as a date is stored as YYYY-MM-DD in the database, on the client side dates can be displayed in different formats, the value of a field, eg AY_rank, can be displayed as something else.

In this example, AY refers to one judge out of several, who ‘rank’ properties to score them. So the code above would be repeated several times for different judges.

Giving several scores, to give a total score also, with SQL like currently like this:

, noms.AY_score + noms.CG_score + noms.GR_score as judges_score
, scrs.AverageScore + noms.AY_score + noms.CG_score + noms.GR_score as total_score

So its a bit more involved than displaying a different value based on the stored value, but involves storing it and using it to create further calculated values on the client side in the SQL.

Would that still be possible?

Yes of course client side with app connect data bindings you can have as complicated expressions as you want.

So you can combine, calculate, sum etc the different results from the database fields.

1 Like

Thanks George - I guess it will just be a bit of a learning curve for me, but I suspect actually a lot more intuitive once I get my bearings with it all!

here we go I guess my old post could help you. @Teodor helped me out here! Thanx again