All Forums Database
Venkatesh G 17 posts Joined 05/09
31 Jul 2009
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.comThanks & Regards,Venkatesh G

Adeel Chaudhry 773 posts Joined 04/08
31 Jul 2009

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

-- If you are stuck at something .... consider it an opportunity to think anew.

Venkatesh G 17 posts Joined 05/09
31 Jul 2009

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

pawan0608 101 posts Joined 12/07
31 Jul 2009

modify your SQL like thisselect 'venkat' (CASESPECIFIC) as sname, 'VENKAT' (CASESPECIFIC) as uname, (case when sname = uname then 'same'else 'not same'end) as namecase

dnoeth 4628 posts Joined 11/04
31 Jul 2009

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

Dieter

Venkatesh G 17 posts Joined 05/09
03 Aug 2009

Hi Pawan,this is working great for me.Thanks a lot.

Venkatesh G 17 posts Joined 05/09
03 Aug 2009

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.

muji316 3 posts Joined 04/12
26 Sep 2012

 
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

Regards,
Syed Mujtaba Ahmed

pawan0608 101 posts Joined 12/07
27 Sep 2012

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

You must sign in to leave a comment.