DNIBLOB2VARCHAR: BLOB to VARCHAR

Read syntax diagramSkip visual syntax diagramDNIBLOB2VARCHAR(input_blob ,ccsid,'REPORT','REPLACE','repchar')
The user-defined DB2® function (UDF) DNIBLOB2VARCHAR returns the variable-length character (VARCHAR) representation of character code points stored in a binary large object (BLOB). If a null value is specified for any of the mandatory input parameters, DNIBLOB2VARCHAR returns a null value.
input_blob
The BLOB value that is to be converted to character data. To convert FIN messages that are stored in the audit log, specify the column name "AM_BODY".
ccsid
The CCSID of the code page used to encode the character data contained in <input_blob>. This CCSID must be one of those listed in Table 1, and the corresponding character set must be supported by your Java™ runtime environment (see Listing character set names). To convert FIN messages that are stored in the audit log, specify the column name "AM_BODY_CCSID".
REPORT
If one or more code points in the input BLOB cannot be mapped to a character, the function terminates and sets:
  • SQLCODE = -1
  • SQLSTATE = 38W05
REPLACE
If one or more code points in the input BLOB cannot be mapped to a character, each code point that cannot be mapped to characters is represented by the replacement character specified by the repchar parameter.
repchar
The character with which code points that cannot be mapped to characters are to be replaced. The default is the substitution character of the encoding scheme of the program that issues the SQL command.
If the input BLOB cannot be converted, DNIBLOB2VARCHAR returns one of the following SQLSTATE values:
38W01
Character conversion from the indicated CCSID is not supported. Check whether your Java runtime environment supports the corresponding character set (see Listing character set names).
38W04
Error reading the CCSID mapping file, which has the name ccsid_UNIX.properties. The fully qualified name of this file is indicated by the SQL error message.
38W05
The error action REPORT was specified, and the input BLOB contains unmappable code points.
38W06
An invalid value was specified for the indicated parameter.
38W07
The length of the output VARCHAR exceeds 32672 bytes.
Table 1. Character set names and CCSIDs
CCSID Character set name
1208 1209 5304 5305 13496 13497 17592 17593 UTF-8
1204 1205 UTF-16
1200 1201 13488 13489 17584 17585 21680 21681 25776 25777 61955 61956 UTF-16BE
1202 1203 13490 13491 17586 17587 21682 21683 25778 25779 UTF-16LE
367 US-ASCII
878 KOI8-R
921 ISO-8859-13
954 EUC-JP
1375 Big5-HKSCS
5012 ISO-8859-8
5471 MS950_HKSCS
5346 windows-1250
5347 windows-1251
5348 windows-1252
5349 windows-1253
5350 windows-1254
9447 windows-1255
9448 windows-1256
9449 windows-1257
5354 windows-1258
37 ibm037
273 ibm273
277 ibm277
278 ibm278
280 ibm280
284 ibm284
285 ibm285
297 ibm297
420 ibm420
424 ibm424
437 ibm437
500 ibm500
737 ibm737
775 ibm775
838 ibm838
850 ibm850
852 ibm852
855 ibm855
856 ibm856
857 ibm857
858 ibm00858
860 ibm860
861 ibm861
862 ibm862
863 ibm863
864 ibm864
865 ibm865
866 ibm866
868 ibm868
869 ibm869
870 ibm870
871 ibm871
875 ibm875
918 ibm918
922 ibm922
930 ibm930
931 ibm939
939 ibm939
1006 ibm1006
1026 ibm1026
1047 ibm1047
1098 ibm1098
1140 ibm01140
1141 ibm01141
1142 ibm01142
1143 ibm01143
1144 ibm01144
1145 ibm01145
1146 ibm01146
1147 ibm01147
1148 ibm01148
1149 ibm01149
5026 ibm930
5035 ibm939
9030 ibm838
819 IBM-819
912 IBM-912
913 IBM-913
914 IBM-914
915 IBM-915
813 IBM-813
916 IBM-916
920 IBM-920
923 IBM-923
933 IBM-933
935 IBM-935
937 IBM-937
943 IBM-943
949 IBM-949
964 IBM-964
970 IBM-970
874 IBM-874
950 IBM-950
1124 IBM-1124
1025 IBM-1025
1089 IBM-1089
1097 IBM-1097
1112 IBM-1112
1122 IBM-1122
1123 IBM-1123
1381 IBM-1381
1383 IBM-1383
5050 IBM-33722
9066 IBM-874
33722 IBM-33722