Solved

fixing lowercase letters to uppercase

Posted on 2010-09-16
4
436 Views
Last Modified: 2012-05-10
Hi I have the following query which gives the lower case lettered words, is there a way we can fix the lowercase letters to get the uppercase ones?
USE CONTROLM_EM
SELECT      SCHED_TABLE, JOB_NAME
FROM  DEF_JOB A
JOIN  DEF_TABLES B ON A.TABLE_ID = B.TABLE_ID
WHERE DATA_CENTER = 'PROD'
AND SCHED_TABLE NOT LIKE 'WORKSPACE%'
AND CAST(JOB_NAME AS VARBINARY(8000)) <> CAST(UPPER(JOB_NAME) AS VARBINARY(8000))
ORDER BY SCHED_TABLE, JOB_NAME
0
Comment
Question by:shyamaladevib
4 Comments
 
LVL 3

Accepted Solution

by:
ad4m1 earned 167 total points
ID: 33697013
Simply prefix your fields with upper(**FieldName**)
so presuming you want your JOB_NAME to be returned in upper case you would have the following code.
SELECT      SCHED_TABLE, upper(JOB_NAME)
FROM  DEF_JOB A
JOIN  DEF_TABLES B ON A.TABLE_ID = B.TABLE_ID
WHERE DATA_CENTER = 'PROD'
AND SCHED_TABLE NOT LIKE 'WORKSPACE%'
AND CAST(JOB_NAME AS VARBINARY(8000)) <> CAST(UPPER(JOB_NAME) AS VARBINARY(8000))
ORDER BY SCHED_TABLE, JOB_NAME
 
Hope this helps.
0
 
LVL 32

Assisted Solution

by:ewangoya
ewangoya earned 166 total points
ID: 33697739
Use update  

UPDATE DEF_JOB
SET SCHED_TABLE = UPPER(SCHED_TABLE), JOB_NAME = UPPER(JOB_NAME)
WHERE DEF_JOB.TABLE_ID IN
(SELECT A.TABLE_ID
      FROM  DEF_JOB A
      JOIN  DEF_TABLES B ON A.TABLE_ID = B.TABLE_ID
      WHERE DATA_CENTER = ' PROD'
      AND SCHED_TABLE NOT LIKE 'WORKSPACE%'
      AND CAST(JOB_NAME AS VARBINARY(8000)) <> CAST(UPPER(JOB_NAME) AS VARBINARY(8000)))
0
 
LVL 4

Assisted Solution

by:parthmalhan
parthmalhan earned 167 total points
ID: 33710974
try the following code:

USE CONTROLM_EM
SELECT      upper(SCHED_TABLE),upper(JOB_NAME)
FROM  DEF_JOB A
JOIN  DEF_TABLES B ON A.TABLE_ID = B.TABLE_ID
WHERE DATA_CENTER = 'PROD'
AND SCHED_TABLE NOT LIKE 'WORKSPACE%'
AND CAST(JOB_NAME AS VARBINARY(8000)) <> CAST(UPPER(JOB_NAME) AS VARBINARY(8000))
ORDER BY SCHED_TABLE, JOB_NAME
0
 

Author Closing Comment

by:shyamaladevib
ID: 33737364
thanks!
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question