Skip to main content

decode_sqlstt

Function decode_sqlstt 

Source
pub fn decode_sqlstt(body: &[u8]) -> String
Expand description

The SQL text in an SQLSTT body.

DRDA carries it as FD:OCA data: a nullable mixed-character string with a 4-byte length (0x00 | len | bytes), then a nullable single-byte one, of which one is null. The text is in the CCSID the requester declared, which every driver here declares as UTF-8. A body that is not shaped like that is read as bare EBCDIC, the encoding this server’s own byte-literal tests use.