BTEQ - show command loses formatting

Tools
Enthusiast

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?

4 REPLIES
Junior Contributor

Re: BTEQ - show command loses formatting

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.

Enthusiast

Re: BTEQ - show command loses formatting

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. 

Enthusiast

Re: BTEQ - show command loses formatting

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).

Enthusiast

Re: BTEQ - show command loses formatting

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