Search code examples
sybase

Selecting Data from Compressed TEXT Column in Sybase


In Sybase 15.03 we have a table with column named "content" type TEXT. It contains compressed contents of the file, looks something like this when doing straight select: H4sIAAAAAAAAAL2Y21IjOQyG7/cp+nJny9UjWbIszx2QQDIJhMmhanff/0H2d6cpSOKh2ZoMQFWS

How can I select/extract/uncompress/decompress its value, so I can examine its content?

Thank you. Michael


Solution

  • Just do a SELECT of the column, and make sure the SET TEXTSIZE setting is set high enough to avoid the data being truncated. To get the data in a file directly, do a BCP-out (and use the -T flag similarly to SET TEXTSIZE).