How to check if data is in upper case or not

Database
Enthusiast

How to check if data is in upper case or not

Hi all,

I need to check if data in a column is converted from to upper case or not.

Please help me in this regard.

venkatesh.gubba@gmail.com

Thanks & Regards,
Venkatesh G
10 REPLIES
Teradata Employee

Re: How to check if data is in upper case or not

Hello,

I believe there is no built-in function to do that .... though, you can use UPPER/LOWER functions to get the desired case of the data.

Though, there are ways to check the case of the given character at a time, but not a string as a whole .... but UDF can be coded to do the same!

HTH!

Regards,

Adeel
Enthusiast

Re: How to check if data is in upper case or not

Hi Adeel,

When I am trying to compare the strings 'venkat' and 'VENKAT', teradata is showing that both are same.
I want the output that both are not same.

select 'venkat' as sname, 'VENKAT' as uname, case when sname = uname
then 'same'
else 'not same'
end as namecase

Enthusiast

Re: How to check if data is in upper case or not

modify your SQL like this

select 'venkat' (CASESPECIFIC) as sname, 'VENKAT' (CASESPECIFIC) as uname,
(case when sname = uname then 'same'
else 'not same'
end) as namecase
Senior Apprentice

Re: How to check if data is in upper case or not

Hi Venkatesh,
why do you need to know about that?
If you need it in uppercase just use the UPPER function or define the column as UPPERCASE.

Dieter
Enthusiast

Re: How to check if data is in upper case or not

Hi Pawan,

this is working great for me.
Thanks a lot.
Enthusiast

Re: How to check if data is in upper case or not

Hi Dnoeth,

I was provided a table with millions of records of data and lots of business rules on which this table was built.
I need to validate the table against those business rules and one of the business rule is that the data in one of the column should be in upper case.

for the above mentioned biz rule i need to write a query which would tell me if any record is not in upper case.

Re: How to check if data is in upper case or not

Hi,

You can use  below function to get all the records starting from capital letter 'A' to 'Z'

char2hexint( substr(EMP_NAME,1,1)) between  '41' and  '5A'

Regards,

Syed Mujtaba Ahmed

Enthusiast

Re: How to check if data is in upper case or not

This will tell you only wheather your first char is in uppercase or not

Visitor

Re: How to check if data is in upper case or not

Hi Deiter, 

How do we check if a particular column has upper case or lower case values. UPPER will get only all the values in UPPERCASE. But how to check if a column's existing values are in upper case or lower case?