![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Hi Seldom. Yes, it would be a nice feature. I think the problem is the c0 or char(0) format specifiers. They are interpreted as char which means pad with spaces to the length of the field. I use external tools like awk and sed to trimup the extra spaces. Try this: declare global temporary table tt as select trim(c1) + ',' + trim(c2) + ',' + trim(c3) + ',' as col1 from t on commit preserve rows with norecovery \p\g copy session.tt(col1=c0nl) into 'b.dat' \p\g and then cut -f1-3 -d, b.dat > c.dat or FOR /F "tokens=1,2,3 delims=," %i in (b.dat) do @echo %i,%j,%k>>c.dat ... |
#12
| |||
| |||
|
#13
| |||
| |||
|
|
Hmm. It's useful to know about tricks with *sql* and the -S and -v flags (and \trim for that matter) because you don't always want the data for a database, but I certainly would not recommend learning or using them before mastering COPY...INTO. COPY...INTO is quite carefully designed to prevent problems and you subvert it at your peril. -- rhann ------------------------------------------------------------------------ rhann's Profile:http://community.ingres.com/forum/member.php?userid=131 View this thread:http://community.ingres.com/forum/sh...ad.php?t=13849 |
#14
| |||
| |||
|
#15
| |||
| |||
|
|
Try this: copy session.tt(col1=vchar(0)comma, col2=vchar(0)comma, col3=vchar(0)nl) into 'b.dat' \p\g The vchar specification trims white space off both char and vchar fields. It's very useful. I don't think it's documented however. |
#16
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |