All Forums Tools
loafob 5 posts Joined 11/09
30 May 2014
BTEQ - show command loses formatting

Hello,
 
I am using BTEQ to create files containing table definitions. The command is working, but the resulting DDL files have lost all newlines and are instead smooshed together on a single line. Is there a way to retain the source formatting (if there is such a thing) to keep the DDL readable?
 
 

dnoeth 4628 posts Joined 11/04
30 May 2014

This might be due to different linebreaks on Unix/windows.
Did you use SHOW TABLEs?
Did you run BTEQ on Linux and open the DDLs on Windows?
e.g. WordPad can deal with Unix linebreaks, but not Notepad.

Dieter

loafob 5 posts Joined 11/09
30 May 2014

Thanks for the response Dieter!
 
And yea, I used a show:
 

cat << !* > $runscript
.logon $TERADATA_DATABASE/$TERADATA_USER,$TERADATA_PASSWORD;
.SET ECHOREQ OFF
.EXPORT REPORT FILE = getDDL.output;
.set titledashes off
.set format OFF
.SET WIDTH 500

show table $db.$obj;

.EXPORT RESET
.QUIT;
!*

I am viewing the file in vi. 

Raja_KT 1246 posts Joined 07/09
30 May 2014

It can be on the unix/linux settings. You can see someone's .profile file FOR  the settings of screen maybe.
With xterm/rxvt/gterm  we can adjust
with (xterm -sl 100 or some numbers..)
Also try to adjust your TD settings (.SET).

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

loafob 5 posts Joined 11/09
02 Jun 2014

Thanks Raja, I messed with all the .SET arguments I could find, and nothing worked well for me. In the interim, I have just piped the resulting file to sed and appended a LF:
 

echo `cat getDDL.output` | sed 's/, /,\
/g' > $db.$obj

 
good enough for my purposes.
 
Thanks

You must sign in to leave a comment.