Skip to Content
1
Jul 10, 2019 at 08:20 PM

Why on earth doesn't HANA BINTOTEXT() work on STXL.CLUSTD

839 Views

I've seen many posts asserting that SAP binary text can't be read in HANA. I haven't found the reference, but I suspect STXL.CUSTD is some other protocol than CESU-8, which is what HANA BINTOTEXT() requires.

I've tried many, many combinations of conversion functions (SQL in HANA Studio), and am tantalized by the idea that the exact combination will open the treasure chest.

Anybody had success in this forest?

Here are a sample of three trials

  1. SELECT BINTOSTR(TO_BINARY(TO_BLOB("CLUSTD"))) as EDIText

    from "SAPPRD"."STXL"

    WHERE"TDNAME" = '0030000462000010'

    /*Result: Could not complete result operation. com.sap.db.jdbc.exceptions.Cesu8ConversionException Invalid CESU-8 sequence*/

  2. SELECT BINTOSTR(TO_BINARY("CLUSTD") ) as EDIText, "CLUSTD"

    from "SAPPRD"."STXL"

    WHERE"TDNAME" = '0030000462000010'

    /*Result: executes, but null*/

  3. SELECT cast(BINTOSTR(cast(CLUSTR as binary)) as varchar) as EDIText, "CLUSTD"

    from "SAPPRD"."STXL"

    WHERE"TDNAME" = '0030000462000010'

    /*Result: executes, Integer of unknown calculation*/