PL/SQL Append string to existing string

Hello expert,
Currently these values exist in the CRM_CASE table
CRM_CASE_ID                  CRM_GUID
CAS-1045522-V1F4F9          689fe3ed-be73-e711-811b-005056
CAS-1053908-R1H3X2          ec6ea10b-4f7d-e711-811b-005056
CAS-1056154-N0T8S4          66592627-df7e-e711-811b-005056
 
The CRM_GUID strings should have ‘85df8c’  at the end of each string. Like

FIX      
CRM_CASE_ID                 CRM_GUID
CAS-1045522-V1F4F9         689fe3ed-be73-e711-811b-00505685df8c
CAS-1056154-N0T8S4         66592627-df7e-e711-811b-00505685df8c
CAS-1053908-R1H3X2         ec6ea10b-4f7d-e711-811b-00505685df8c

So a query was drafted

UPDATE CRM_CASE
SET CRM_GUID = CRM_GUID + ‘85df8c’
where CRM_CASE_ID in
('CAS-1045522-V1F4F9',
'CAS-1053908-R1H3X2',
'CAS-1056154-N0T8S4')

This returns

Error at Command Line:2 Column:26
Error report:
SQL Error: ORA-00911: invalid character
00911. 00000 -  "invalid character"
*Cause:    identifiers may not start with any ASCII character other than
           letters and numbers.

Pretty sure that the plus sign is the fly in the ointment. But research
does not reveal how to append a string to a string.

What is the correct syntax to do this?

Thanks.

Allen in Dallas
LVL 1
Allen PittsBusiness analystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
In Oracle you use || instead of + for string concatenation.
But the error message results from typographical quotes ‘ and ’ instead of ticks ', enclosing 85df8c.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bill PrewIT / Software Engineering ConsultantCommented:
Qlemo has given you the answer, points to him if that works for you, but just in case it's still not clear your query should look like.

UPDATE CRM_CASE
SET CRM_GUID = CRM_GUID || '85df8c'
where CRM_CASE_ID in 
('CAS-1045522-V1F4F9',
'CAS-1053908-R1H3X2',
'CAS-1056154-N0T8S4')

Open in new window


»bp
Vaibhav GoelMSBI , SQL ConsultantCommented:
Hello Allen

We can also use CONCAT for concatenation of strings in Oracle.

UPDATE CRM_CASE
SET CRM_GUID = CONCAT( CRM_GUID , '85df8c' )
where CRM_CASE_ID in
('CAS-1045522-V1F4F9',
'CAS-1053908-R1H3X2',
'CAS-1056154-N0T8S4')

More good read from techonthenet
https://www.techonthenet.com/oracle/functions/concat.php

Vaibhav
Bill PrewIT / Software Engineering ConsultantCommented:
It's true you can use the Concat() function for string concatenation, and I certainly have used it when it made sense.  Typically for me this is when several chunks have to be joined, and perhaps some of them aren't simple string literals or columns.  Then it can aid readability.

Just be aware that Concat() is a function, whereas || is an operator.  My old school training taught that functions carried more overhead than operators and so could perform slightly slower.  As a result I often prefer operators or SQL statements to functions.  On today's fast computers it often makes no different, and readability can be different, but just wanted to mention this subtle different for information.


»bp
Allen PittsBusiness analystAuthor Commented:
Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.