cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

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

peter_schubert314
Discoverer
1,575

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*/

Accepted Solutions (0)

Answers (1)

Answers (1)

stuart_paull
Explorer
0 Likes

I believe the data is stored in a compressed format (no idea of what internally the system uses). Its effectively a BLOB and only the application knows how to decode and process the actual data stored in it, so you have to go through the READ_TEXT FM to process it to return it as an internal table of lines of text. The way it is processed internally by the system it may be stored in the DB as multiple rows with the same ID depending on the size of the text being stored.