×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Concat a text string gives space between??

Concat a text string gives space between??

Concat a text string gives space between??

(OP)
Hi all,
I am running the following sql to convert a decimal string to hex and its fine but I then need to compare that value to a different data source which already has the value in hex.  Trouble is the second source appears to have two have two zeros at the start of each hex string, so I figure I need to manually add these to the start of the converted string.

CODE


SELECT
EMPLOYEE_ID, PLACE, STATUS, STARTDATE, STARTT, ENDT, DURATION, CONCAT('00',TO_CHAR(CONNID,'XXXXXXXXXXXXXX'))
FROM SOF.V_STATUS WHERE EMPLOYEE_ID ='Mouse_M_34317'
AND STARTDATE='25/06/2009'

The issue I have is that when I do this, the result of the CONNID field is '00 7201B0CE7DA7EE' and the space at the start will cause me a problem.  If I reduce the X's in the TO_CHAR statement by one, the I get this result '00###############' which I believe is because I havent specified enough characters in the to_cahr statement.

Im not sure what I am doing wrong and how to get rid of that strange space which appears?

John
smile

RE: Concat a text string gives space between??

(OP)
Sorry PHV have posted in the oracle forum

John
smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close