Interesting results about SQLEXP for Oracle

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
LWExplorer
Posts: 7
Joined: Tue Oct 10, 2017 12:44 pm

Interesting results about SQLEXP for Oracle

Post by LWExplorer » Tue Sep 15, 2015 4:16 pm

Hi,____This is related to Topic 1519, Oracle report fields empty______Our varchar2 fields were showing as blank, and it was recommended that we use SqlExp and Cast. Didn^t work.______However, several interesting results, after some testing today:____0. Using Oracle^s SUBSTRING() doesn^t help. Still blank.______1. If the varchar field happens to be numeric digits, then you can CAST AS NUMBER, to show the field as a number without leading zeros. So if your field name is____VARCHARFIELDWITHDIGITS, then you can do this:____SQLEXP("CAST(VARCHARFIELDWITHDIGITS AS NUMBER)")______2. You can use Oracle^s ASCII() function, to return the ascii codes of individual characters, and CHR() to convert it back.____HOWEVER - it will interpret ALL characters, as UPPERCASE.____So e.g., if you use this:______SQLEXP( "ASCII( ^t^ )" ), it will return an 84.____SQLEXP( "ASCII( ^T^ )" ), this will ALSO return an 84.______If you use Oracle^s CHR() to convert the ascii code back, naturally it will return the uppercase ^T^.______3. You can use Oracle^s ASCIISTR() to convert the entire character field to an ascii character string. If you^re only using Ascii characters in that field, then this would be perfect - EXCEPT that it converts everything to UPPERCASE.____So,____SQLEXP( "ASCIISTR( ^what the^ )" ) returns ^WHAT THE^.______Any ideas?__________

LWExplorer
Posts: 7
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Interesting results about SQLEXP for Oracle

Post by LWExplorer » Tue Sep 15, 2015 4:37 pm

The Oracle CHR() function works fine.______SQLEXP( "CHR( 84 )" ) returns ^T^______SQLEXP( "CHR( 116 )" ) returns ^t^.______So, the problem is with the way the Oracle driver interprets ASCII() and ASCIISTR()________

Post Reply