Q
Problem solve Get help with specific problems with your technologies, process and projects.

Concatenating a string to a number

I have some numbers which are not uniform in size. Now if I have to put '.TIF' at the end of each number, which...

command can I use? For example, 123, 4567, 78901. This I want to update as 123.TIF, 4567.TIF...

All you need to do here is CAST the number as a VARCHAR datatype and then do the concatenation --

select cast(yournumber as varchar(8)) || '.TIF'
  from yourtable

When the number is converted to VARCHAR, it becomes a string that is just long enough to hold the digits of the number. Use a varchar length that is big enough to hold the largest number.

For More Information


This was last published in June 2002

Dig Deeper on Oracle and SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close