How to select CLOB data type data from db2

SELECT CAST (ATTCH_BODY AS CLOB(30720)) INTO :WS-ATTCH-BODY FROM NBASRDOCUM 05 WS-ATTCH-BODY SQL TYPE IS CLOB(32K). 

When I try to select clob data using the above query, it shows all zeros (0) in the variable.

Please recommend me how to choose the clob data clob . In fact, I inserted a 2k text file from the GUI into this variable ( ATTCH_BODY ). I need to send it back to the GUI using XML strings.

+4
source share
1 answer

I did something like the following.

 select cast(CLOBCOLUMN as varchar(32000)) from TABLENAME where cast(TABLENAME.CLOBCOLUMN as varchar(32000)) like '%AString%' for read only; 
+4
source

Source: https://habr.com/ru/post/1447737/


All Articles