5

I am trying to take a column that stores a id # for a webpage on a site and store it with the full url.

If the Article ID is 5. I want it to store return something like this

<a href="http://website.com/5">5</a>

What I am trying to do is combine a string put in the search and a number to make a URL for the column. I know this syntax is incorrect but I can not find anyway on how to do it.

SELECT
CASE                                                                        
WHEN m_tableFoo.articleId = '0' THEN                                
    'Not Applicable'                                                    
ELSE '<a href="http://website.com/'+m_tableFoo.articleId+'/">'+m_tableFoo.articleId+'</a>' 
END AS articleID
from m_tableFoo

I have tried searching the web and Stack Overflow, but I am not sure if my search wording is incorrect or my description.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Halfwarr
  • 7,853
  • 6
  • 33
  • 51

1 Answers1

16

oracle uses || for concatenation, not +. You will probably also need to TO_CHAR the article ids

paul
  • 21,653
  • 1
  • 53
  • 54
  • 2
    Just to complete this statement: `||` is the SQL standard for string concatenation and besides MySQL and Microsoft all DBMS vendor comply with that. –  Jan 21 '13 at 17:20