NO. SQL quickie

dlr at futurechalk.com dlr at futurechalk.com
Tue Dec 27 17:53:53 UTC 2022


Hello Mike,

To do this type of sql you will have to put the lva value in single quotes like when ‘[lvA]’ =… this should work. Otherwise Postgres thinks it is a column in the table.

Dan Ridinger

> On Dec 26, 2022, at 6:49 PM, Mike Rowan <michael.rowan3 at gmail.com> wrote:
> 
> Hi everyone. I hope that you all are safe in these challenging times.
> 
> I need to write a SQL statement including lines something like this:
> 
> Here, lvA is an Omnis local variable, not part of the data.
> Sta: CASE WHEN [lvA] = 'B' THEN 1 ELSE 0 END AS result_b
> 
> I haven't found a way of writing this without PostgreSQL complaining that
> lvA is not a column in the data.  Using IF leads to a very messy bunch of
> code because lvA can have 5 possible values.
> 
> Has anyone got a way to do this?
> 
> Mike
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list