DB2 Scalar functions - BLOB


Volta a página anterior

Volta ao Menu das scalar functions

Volta ao Menu Principal


Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

BLOB

The BLOB function returns a BLOB representation of a string of any type.

BLOB(string-expression ,integer)

The schema is SYSIBM.

string-expression
An expression that returns a value of a character string, graphic string, or binary string data type.
integer
An integer value specifying the length attribute of the resulting BLOB data type.
If integer is not specified, the length attribute of the result is the same as the length of the input, except where the input is graphic.
In this case, the length attribute of the result is twice the length of the input.

The result of the function is a BLOB.
If the argument can be null, the result can be null; if the argument is null, the result is the null value.

Example

Given a table with a BLOB column named TOPOGRAPHIC_MAP and a VARCHAR column named MAP_NAME, locate any maps that contain the string 'Pellow Island' and return a single binary string with the map name concatenated in front of the actual map.

   SELECT BLOB(MAP_NAME  CONCAT ':  ') CONCAT TOPOGRAPHIC_MAP
   FROM   ONTARIO_SERIES_4
   WHERE  TOPOGRAPHIC_MAP LIKE BLOB('%Pellow Island%')

© Copyright IBM Corp.