scottyjohn
Technical User
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.
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
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