Solved

fixing lowercase letters to uppercase

Posted on 2010-09-16
4
429 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In this article I will describe the Backup & Restore 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.
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now