Home > database >  DB2 is similar to the oracle of the convert such code conversion function
DB2 is similar to the oracle of the convert such code conversion function

Time:10-01

DB2 is similar to the oracle of the convert the transcoding function, if not, what method can be at the time of the Order by, specify the sorting in some code?

CodePudding user response:

2, the CONVERT ()
CONVERT (& lt; Data_ type> (length), & lt; Expression> [style])
1) data_type for SQL Server system defined data types, user-defined data types cannot be used here,
2) length is used to specify the length of the data, the default is 30,
3) the CHAR or VARCHAR types such as INT or SAMLLINT converted to an INTEGER type, the results must be numerical, plus or minus sign
4) type TEXT to CHAR or VARCHAR type conversion for a maximum of 8000 characters, namely CHAR or VARCHAR data type is the maximum length,
5) storage of data into BINARY IMAGE type or types VARBINARY, up to 8000 characters,
6) convert the integer value to MONEY or SMALLMONEY types, according to the definition of the country's monetary unit, such as RMB, dollars, pounds, etc.,
7) BIT type conversion convert non-zero value to 1, and are still in storage, BIT type
8) attempts to convert to the different length of data types, the value will be truncated transformation and display "+", after the conversion value to identify the truncation,
9) with the CONVERT () function style options to different formats display date and time, the style is converting DATATIME and SMALLDATETIME data strings are chosen by the SQL Server system to provide the transformation of the style number, different style number have different output formats,

CodePudding user response:

What I want is the role of transcoding, demand is the database is now SHIFT JIS, but sorting and comparison, need to use EBCDIC for processing, the results of a survey is now:
  •  Tags:  
  • DB2
  • Related