|
Archives of the TeradataForumMessage Posted: Thu, 15 Sep 2005 @ 16:49:11 GMT
<-- Anonymously Posted: Thursday, September 15, 2005 11:56 --> Thanks for the feedback thus far. I will be running my SQL-generation script on MP-RAS Unix, therefore I would expect '0A'XC to generate a newline character. My simple SQL is shown below in the BTEQ script. When I look at the file, I want my output to look like this: 1 one 2 two Rather than this: 1 one 2 two The Unix "od" command octal output below shows that BTEQ inserted a space (040) rather than my newline character. Why would this be? Can I do anything else to force the newline? Is there a BTEQ command I don't know about? Very picky I know, but I want to email the output SQL with the chosen line breaks to myself, then visually verify its correctness before cutting and pasting it into SQL Assistant. Having the lines broken where I want them will make my SQL much more readable. .set width 254 .set titledashes off .export file=runtest.out select '1 one' || '0A'XC || '2 two ' (title '') ; .export reset BTEQ 08.02.02.01 Thu Sep 15 11:42:39 2005 +---------+---------+---------+---------+---------+---------+---------+ .logon ohme/ohmy, *** Logon successfully completed. *** Transaction Semantics are BTET. *** Character Set Name is 'ASCII'. *** Total elapsed time was 1 second. +---------+---------+---------+---------+---------+---------+---------+ .set width 254 +---------+---------+---------+---------+---------+---------+---------+ .set titledashes off +---------+---------+---------+---------+---------+---------+---------+ .export file=runtest.out *** To reset export, type .EXPORT RESET +---------+---------+---------+---------+---------+---------+---------+ select '1 one' || '0A'XC || '2 two ' (title '') ; *** Query completed. One row found. One column returned. *** Total elapsed time was 1 second. +---------+---------+---------+---------+---------+---------+---------+ .export reset *** Output returned to console. --------+---------+---------+---------+---------+---------+- *** Warning: EOF on INPUT stream. *** BTEQ exiting due to EOF on stdin. *** Exiting BTEQ... *** RC (return code) = 0 + cat runtest.out 1 one 2 two + od -b runtest.out 0000000 061 040 157 156 145 040 062 040 164 167 157 012 0000014 + od -c runtest.out 0000000 1 o n e 2 t w o \n 0000014
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||