Namburi Akhil
Namburi Akhil

Reputation: 39

Make a specific string Upper case in SQL

I'm trying to change the specific string to upper case my code is

update $table 
set work_log_history = concat(("$created_by response on $toDate $history"||chr(10)),work_log_history) 
where id="$id"

In the above query I want to make $created_by string UPPERCASE.

Upvotes: 1

Views: 167

Answers (3)

Namburi Akhil
Namburi Akhil

Reputation: 39

" update $table set work_log_history=concat(UPPER('$created_by '),('\tresponse on $toDate $input_data->{comment}'||chr(10)),work_log_history) where id='$id' " and it worked fine.

Upvotes: 0

WJS
WJS

Reputation: 724

I think UPPER() function should work for you in this situation? See the documentation here: https://dev.mysql.com/doc/refman/5.7/en/string-functions.html

So your code would look like:

update $table 
set  work_log_history=concat((UPPER($created_by)," response on $toDate $history"||chr(10)),work_log_history) 
where id="$id"

Upvotes: 2

Priyanka Sankhala
Priyanka Sankhala

Reputation: 868

Use upper() function

update table_name set field =UPPER(filed) where id=1

Upvotes: 0

Related Questions