Author |
Message
|
ajit1981 |
Posted: Fri Apr 09, 2010 2:05 am Post subject: Convert Current TimeStamp into HEX |
|
|
Apprentice
Joined: 09 Apr 2010 Posts: 41 Location: Bangalore, Inida
|
Hi,
Is there is any ESQL Function to convert the Current TimeStamp into HEX value. We need to send the Current TimeStamp into HEX value. Wonderning is there is any function in ESQL to convert or do we need to write some function for this. Can anyone help me to write function for this.
Thanks in Advance |
|
Back to top |
|
 |
kimbert |
Posted: Fri Apr 09, 2010 2:15 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
What's the requirement? What particular 'hex value' do you want to get? |
|
Back to top |
|
 |
ajit1981 |
Posted: Fri Apr 09, 2010 2:26 am Post subject: |
|
|
Apprentice
Joined: 09 Apr 2010 Posts: 41 Location: Bangalore, Inida
|
We need to insert the current timestamp into HEX format in database. Application team want the timestamp value in HEX format. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Apr 09, 2010 2:57 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Describe the format. 'HEX' could mean anything at all. |
|
Back to top |
|
 |
ajit1981 |
Posted: Fri Apr 09, 2010 3:12 am Post subject: |
|
|
Apprentice
Joined: 09 Apr 2010 Posts: 41 Location: Bangalore, Inida
|
we need to insert the timestamp value in Hex value. Field is declare as a character in Database. What ever the Current TimeStamp value will be we need to insert this as a Hex value in database. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Apr 09, 2010 3:17 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I give up.  |
|
Back to top |
|
 |
Gaya3 |
Posted: Fri Apr 09, 2010 3:31 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
ajit1981 wrote: |
we need to insert the timestamp value in Hex value. Field is declare as a character in Database. What ever the Current TimeStamp value will be we need to insert this as a Hex value in database. |
Insert the timestamp value in Hex Value
Field is declared as character in Database
Dude better understand the thing pretty well and shoot the question properly. _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
ajit1981 |
Posted: Fri Apr 09, 2010 3:51 am Post subject: |
|
|
Apprentice
Joined: 09 Apr 2010 Posts: 41 Location: Bangalore, Inida
|
Let me tell you the requirement. Application team want that database field should always update with greater than previous value, but we are not authorized to check what is the value currently in database. So we can't retrieve the current value and update with greater value.
So they come up with idea to insert the timestamp value in that field, so that it will always greater than value from previous value. But that field is declare as only 10 digit(Max lenght) and timestamp field value is more than 10 digit. So they are telling to insert the data into HEX value, so it will fit in 10 digit. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Fri Apr 09, 2010 4:17 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Quote: |
Application team want that database field should always update with greater than previous value |
With you so far but soon it all gets a little weird....
Quote: |
but we are not authorized to check what is the value currently in database
|
How can you know which is greater then? Magic? or are you just assuming your value is the latest?
Quote: |
they are telling to insert the data into HEX value, so it will fit in 10 digit.
|
Maybe an example will help. For example, what "hex" value are you expecting for the current date and time? |
|
Back to top |
|
 |
ajit1981 |
Posted: Fri Apr 09, 2010 4:36 am Post subject: |
|
|
Apprentice
Joined: 09 Apr 2010 Posts: 41 Location: Bangalore, Inida
|
current timeStamp. eg suppose today one records came timestamp value for this will be 04-09-2010 : 18:01:20:111, after 1 or 2 min another records came value will be 04-09-2010 : 18:04:20:111, so every time this value will be greater.
So far they have not come with idea in which HEX format they expecting value. may be in HEX decimal or Char. most probably we will insert the data into HexDecimal. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Apr 09, 2010 4:55 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Seriously, what do you *expect* us to say? You don't even know what the requirement is yet. Come back when you can supply an example of your desired 'hex' format. |
|
Back to top |
|
 |
hallmark |
Posted: Fri Apr 09, 2010 5:00 am Post subject: |
|
|
 Voyager
Joined: 10 Mar 2005 Posts: 76
|
Maybe OP wants 04-09-2010 : 18:01:20:111 to only take up 10 characters?
Some kind of packed decimal format inline with some DB representations (e.g. DB2...)
DB2 InfoCenter
Quote: |
Timestamp
A timestamp is a seven-part value (year, month, day, hour, minute, second, and microsecond) designating a date and time as defined above, except that the time includes a fractional specification of microseconds.
The internal representation of a timestamp is a string of 10 bytes. Each byte consists of 2 packed decimal digits. The first 4 bytes represent the date, the next 3 bytes the time, and the last 3 bytes the microseconds. |
For the OP to clarify though as you say, and I am sure that this is what you are trying to draw out (educate)... _________________ Rob |
|
Back to top |
|
 |
ajit1981 |
Posted: Fri Apr 09, 2010 10:44 pm Post subject: |
|
|
Apprentice
Joined: 09 Apr 2010 Posts: 41 Location: Bangalore, Inida
|
Thanks a lots Rob!! for your help,. If internal representation of a timestamp is a string of 10 bytes, then we will proceed towards this way. |
|
Back to top |
|
 |
hallmark |
Posted: Fri Apr 09, 2010 11:50 pm Post subject: |
|
|
 Voyager
Joined: 10 Mar 2005 Posts: 76
|
I really don't think I have helped, infact I have possibly hindered you by trying to guess your requirements which the other guys were rightly trying to get you to give us...
My intention was to try and provoke you to understand what you are trying to achieve...that "internal format" was related to the database which is where your DBAs might be coming from, but ordinarily you shouldn't need to worry about that...I don't fully understand your restriction and maybe neither do you.
It may be that you have enough to proceed, but let us know if you have broker issues and try to present your problem as opposed to something that is half a solution...
e.g. I need to insert a millisecond timestamp into a database whose field is (might be!) restricted to 10 CHARACTERS....(or even - I need to insert a guaranteed incremental number into a database field....?) and I still don't really know what your requirement is.
Also if you get to the bottom of this tell us what you did/were doing...
Cheers
Rob _________________ Rob |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Apr 10, 2010 6:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And let not all this information about DB2 and other stuff distract you from the possibility that they might just be angling for a date / timestamp constructor like new java.sql.Timestamp(long)... so they could just be thinking of the long number representing the timestamp....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|