| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

03-03-04, 11:28
|
|
Registered User
|
|
Join Date: Mar 2004
Posts: 3
|
|
|
Removing the quotes(" ") around the column
|
|
Hi,
I am trying to export the data into a text file using the following script.
db2 "export to /home/tigher/USER.txt of del select ROW_ID, CREATED,PAR_ROW_ID, LOGIN, USER_FLG FROM SIEBEL.S_USER "
the sample output is as follows:
"1-04AF","2001-01-08-19.09.42.000000","1-04AF","WAWRA","Y"
But here, I don't want the quotes(") around the date value(Created column) and I want to keep the quotes around for the remaining columns. could you someone help me how do I achieve this?
Thanks for your help!
Manu
|
|

03-03-04, 11:53
|
|
:-)
|
|
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
|
|
|
Re: Removing the quotes(" ") around the column
Quote:
Originally posted by kapaluru
db2 "export to /home/tigher/USER.txt of del select ROW_ID, CREATED,PAR_ROW_ID, LOGIN, USER_FLG FROM SIEBEL.S_USER "
the sample output is as follows:
"1-04AF","2001-01-08-19.09.42.000000","1-04AF","WAWRA","Y"
But here, I don't want the quotes(") around the date value(Created column) and I want to keep the quotes around for the remaining columns. could you someone help me how do I achieve this?
|
You could concatenate all columns into a single string while formatting it the way you need:
PHP Code:
export ... select rtrim(row_id) || '",' || rtrim(char(created)) || ',"' || rtrim (par_row_id) || '","' ...
|
|

03-03-04, 12:34
|
|
Registered User
|
|
Join Date: Mar 2004
Posts: 3
|
|
|
|
Thanks for the reply n_i,
I have modified the script based on your suggestion...but getting the Syntax error.Here is the script that I am using and the error message:
db2 "export to /home/tiger/USER.txt of del select rtrim(row_id) || '",' || rtrim(char(created)) || ',"' || rtrim (par_row_id) || '",'" || rtrim(login) || '","' || rtrim (user_flg) || FROM SIEBEL.S_USER "
0403-057 Syntax error at line 5 : `'' is not matched
Could you please confirm whether the modification are correct?
|
|

03-03-04, 14:48
|
|
:-)
|
|
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
|
|
Quote:
Originally posted by kapaluru
Thanks for the reply n_i,
I have modified the script based on your suggestion...but getting the Syntax error.Here is the script that I am using and the error message:
db2 "export to /home/tiger/USER.txt of del select rtrim(row_id) || '",' || rtrim(char(created)) || ',"' || rtrim (par_row_id) || '",'" || rtrim(login) || '","' || rtrim (user_flg) || FROM SIEBEL.S_USER "
0403-057 Syntax error at line 5 : `'' is not matched
Could you please confirm whether the modification are correct?
|
Well, since you run the statement from the OS prompt, whatever it is, you'll have to escape the double quotes within the statement.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|