1

I'm quite new to Oracle and seem to having some problems with my query

Here's what i've got

SELECT (REPLACE(column1, 'test', '') + ': ' + column2) AS column3 FROM table

I get a ORA-01722 invalid number error with this.

I think it's something to do with the +'s but i'm not sure what the correct syntax is.

Any ideas?

3 Answers 3

8

You should use || to concat two strings...

SELECT (REPLACE(column1, 'test', '') || ': ' || column2) AS column3 FROM table
Sign up to request clarification or add additional context in comments.

Comments

4

The correct way to concatenate in Oracle is by using ||

select 'a' || 'b' from dual;

Comments

4

or by using the CONCAT function

(which nobody uses because the double pipe is easier to use, so just trying to be complete here)

Regards,
Rob.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.