Author |
Message
|
madi |
Posted: Fri Feb 03, 2006 7:28 am Post subject: eSQL help |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
Hi All
I have to convert the following things
Code: |
Input:
<tag><Date>2006-02-25</Date><tag>
Output:
<tag><Date>2006-02-25 00:00:00 CST</Date></tag>
|
Code: |
Input:
<tag>
<number1>123</number1>
<number2>45</number2>
<number3>6789</number3>
<tag>
Output:
<tag>
<number>123-45-6789</number>
</tag>
|
I dont need the code but I would appreciate it if you could point me to the manuals to look at how to do such stuff.
Thanks
madi |
|
Back to top |
|
 |
rkford11 |
Posted: Fri Feb 03, 2006 7:45 am Post subject: Re: eSQL help |
|
|
Partisan
Joined: 06 Jun 2004 Posts: 316
|
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Feb 03, 2006 7:46 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There's more than one way to do both of these. So there are different sections in the InfoCenter.
If you decide to model this, then you can look in the sections on the MRM.
If you decide to leave it as unmodelled XML, then you can look in the sections on ESQL and how to identify XML elements and attributes and etc. using ESQL. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
madi |
Posted: Fri Feb 03, 2006 8:09 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
OK i was able to use CAST and convert the date into a time stamp but how do I add the timezome to it?
Also I am not able to find how to do the second transformation.
Is there something like
SET timezone = timestamp + 'CST' (append it to the timestamp)
Also in general is there append function to club two data fields into one?
thanks
madi |
|
Back to top |
|
 |
JT |
Posted: Fri Feb 03, 2006 8:19 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
madi |
Posted: Fri Feb 03, 2006 8:27 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
Thanks
Got what i needed.
--madi |
|
Back to top |
|
 |
madi |
Posted: Fri Feb 03, 2006 9:25 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
Hi
When im using
CAST(mydate AS CHAR) it is giving me 'DATE 2006/02/03'
but I only need '2006/02/03' in the output
can i get rid of it in any way?
thanks
madi |
|
Back to top |
|
 |
JT |
Posted: Fri Feb 03, 2006 9:34 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Code: |
SET mydate = SUBSTRING(mydate FROM 6); |
|
|
Back to top |
|
 |
madi |
Posted: Fri Feb 03, 2006 9:40 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
|
Back to top |
|
 |
madi |
Posted: Fri Feb 03, 2006 10:40 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
Is there a function to add leading 0s after checking the number of digits in the number?
ex input: 12
Output: 0012
input: 123
output : 0123
thanks
madi |
|
Back to top |
|
 |
madi |
Posted: Fri Feb 03, 2006 10:43 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
|
Back to top |
|
 |
JT |
Posted: Fri Feb 03, 2006 10:44 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Okay, now it's time for you to crack open the books.
Start here |
|
Back to top |
|
 |
|