AW: List Column Rearrangement

Martin Obongita martin.obongita at yahoo.com
Thu Feb 10 09:26:34 UTC 2022


I didn't know I could switch from a BOOL without fetching the column.
I'm grateful, pal. Very helpful.


Sent from Yahoo Mail on Android 
 
  On Thu, 10 Feb 2022 at 12:01, Rudolf Bargholz<rudolf at bargholz.ch> wrote:   Hi Martin,

A list is just data and has only an indirect effect on the display of data.

Do List.$definefromsqlclass('MySchema','SEQVAL','BOOLVAL')
Do List.$cols.$add('BOOLCHAR',kCharacter,kSimplechar,10)

Begin statement
Sta: select
Sta:  SEQVAL
Sta:  ,BOOLVAL
Sta:  ,CASE BOOL when 1 then 'FEMALE' ELSE 'MALE' END as BOOLCHAR
Sta:  from MYTABLE
End statement

When you fetch the data from the table, the CHAR value of the bool is added to the list, and you can how use the new column BOOLCHAR in your headed list, for example, as a display column. Even though the list has a column BOOLVAL, you do not need to display this value. So, there is no need to remove a column defined from the SQL class.

If you really want to "remove" the column, then don't fetch it:

Do List.$definefromsqlclass('MySchema','SEQVAL')
Do List.$cols.$add('BOOLCHAR',kCharacter,kSimplechar,10)

Begin statement
Sta: select
Sta:  SEQVAL
Sta:  ,BOOLVAL
Sta:  ,CASE BOOL when 1 then 'FEMALE' ELSE 'MALE' END as BOOLCHAR
Sta:  from MYTABLE
End statement

Regards

Rudolf Bargholz

-----Ursprüngliche Nachricht-----
Von: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> Im Auftrag von Martin Obongita via omnisdev-en
Gesendet: Donnerstag, 10. Februar 2022 08:45
An: omnisdev-en at lists.omnis-dev.com
Cc: Martin Obongita <martin.obongita at yahoo.com>
Betreff: List Column Rearrangement

Hi Listers,
I have defined a list from sql table class. I have a boolean column in the list for gender. I have added a column(kChar) to represent gender (male,female). I wish to remove the boolean column and replace it with the new column kChar. The user manual says I cannot remove a column defined from sqlclass. But can't I merge two lists and leave out the boolean column?Or move the gender boolean column from column-1 to the last column?    

Any better ideas will be highly appreciated.
Kind regards, Martin O.
_____________________________________________________________
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