Accents and Letters with Character Codes, sql, dropdown

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
User avatar
Dino
Posts: 88
Joined: 19 May 2017, 08:29

Accents and Letters with Character Codes, sql, dropdown

Post by Dino »

Hi

If you have a simple table, with information like this:

Code: Select all

ID          DESCRIP           
A1          Niño              
A2          María             
A3          Canción           
A4          Mamá              
A5          Euro Code is €    
and you use aXes to runqry *n that table you get this:
dd01.jpg
dd01.jpg (63.74 KiB) Viewed 8046 times
which shows the data correctly (well, kind off, I missed the euro money character),
but if I use the same table in a dynamic dropdown, and create the dynamic table like this:

Code: Select all

-- ====================================================================================
-- Test Drop Down
-- ====================================================================================
    DefineObjectInstance { 
      className          = "DynamicTable", 
      name               = "TestDD",   
      source             = "sql", 
      selectSQLcommand   = "ID,DESCRIP from QGPL.TESTDD", 
      resultColumnNames  = { "value", "text" }, 
    }; 
I get this in the dropdown:
dd03.jpg
dd03.jpg (76.47 KiB) Viewed 8046 times
Is there any way to keep the accent characters in the dropdown? if not, any way to replace those? I tried using REPLACE in the SQL instruction, but seems that the data already arrives with garbage characters instead of the correct ones...

Happy holidays!
User avatar
Dino
Posts: 88
Joined: 19 May 2017, 08:29

Re: Accents and Letters with Character Codes, sql, dropdown

Post by Dino »

Just sharing the solution here:
https://axesdocs.lansa.com.au/index.php ... -documents

Code: Select all

DefineObjectInstance {
      className          = "StaticTable",
      name               = "TEST03",  
      source             = "sql",
      selectSQLcommand   = "EMPNO, CAST(EMNAM AS CHAR(14) CCSID 65535), CAST(EMADR AS CHAR(62) CCSID 65535) from QGPL.PBEMPF",
      resultColumnNames  = { "value", "text", "address" },
      resultColumnCCSID  = { text=937, address=937 };
   };
  
just to use 284 instead of 937 and dynamic table instead of static.
User avatar
Dino
Posts: 88
Joined: 19 May 2017, 08:29

Re: Accents and Letters with Character Codes, sql, dropdown

Post by Dino »

just adding an extra note here, when accessing some sample tables in LANSA with nvarchar fields, using value 1140 for the CCSID does the trick.
Post Reply