View previous topic :: View next topic
|
Author |
Message |
tecnokrat Warnings : 1 Active User
Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
Hi ,
I need to update a column in the table whose Hex equivalent should be equal to 01.
Quote: |
UPDATE Table A
SET Col1 = (SUBSTR(Col1,11,1),X'01')
WHERE A= 999
and B= 99
and c = 'ST';COMMIT;;;; |
when ran the above query in SPUFI it gives me the below error
Quote: |
SQLCODE = -104, ERROR: ILLEGAL SYMBOL ",". SOME SYMBOLS THAT MIGHT
BE LEGAL ARE: MICROSECONDS MICROSECOND SECONDS SECOND MINUTES MINUTE
HOURS
|
even I tried with the
Quote: |
UPDATE Table A
SET Col1 = (SUBSTR(Col1,11,1),HEX'01')
WHERE A= 999
and B= 99
and c = 'ST';COMMIT;;; |
Is there any way that i directly update the value to a HEX equivalent |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Hex Function -
The HEX function returns a hexadecimal representation of a value. |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi,
your requirement is not clear.
What exactly you want to do?
you want to update COL1 when it's Hex equivalent should be equal to 01 or you want to update COL1 to hex equivalent of 01
Can you please elaborate on requirement |
|
Back to top |
|
|
tecnokrat Warnings : 1 Active User
Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
I want to update the col1 to hex equivalent of 01 |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Technokrat,
Observations:
1.You said you wanted to updated hex equivalnet of 01 but it is SUBSTR(Col1,11,1),X'01') ( Still I am clueless what is needed here)
2.Col1 = (SUBSTR(Col1,11,1),X'01') guess it should be Col1 = SUBSTR(Col1,11,1)||X'01'
3.In your next reply please use code tags and show us sample input data and sample output data considering X'01' is a '.'
4.Failing reply for the above observations you may not get a reply |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
[quote="premkrishnan"]3.In your next reply please use code tags and show us sample input data and sample output data considering X'01' is a '.'
No x'01' is not a '.' it is a non-displayable character that often is displayed as a '.' but it is definitely not a '.' which in EBCDIC is a hex'4b' or in ASCII is a x'2e'. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Hi Craq,
I understand that but I just wanted Technokrat to display the x'01' as '.'
like assume |
|
Back to top |
|
|
|