Archives of the TeradataForum
Message Posted: Tue, 02 Jan 2007 @ 09:56:25 GMT
Kumar Veerappan wrote:
This is a perfect case for a UDF.
If you don't want (or can't) write an UDF, but already installed the available Oracle-UDFs from Teradata.com, you can do it the old way:
SELECT CHAR_LENGTH('AACCFFAAGRTA') -CHAR_LENGTH(oreplace('AACCFFAAGRTA','A',''))
There's no function for it, but you can query dbc.columns.
For Char/Varchar ColumnLength represents the physical size:
"char(30) charcter set LATIN" -> 30 "char(30) charcter set UNICODE" -> 60
To calculate the maximum number of chars you have to check CharType. If you only got LATIN (1) and UNICODE (2) do a simple ColumnLength/CharType.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|