Teradata SQL

Database

Teradata SQL

I have created a dynamic SQL script to create a large number of users. I am trying to format the output to be more readable. Does anyone know how to put carriage returns and tabs into the output?
1 REPLY
N/A

Re: Teradata SQL

If you use bteq to build the script, use .FOLDLINE to split across lines.

eg:

.Export Report file = filename

.Foldline on All
.Heading Off
Select
'Create User'||usrname (Title ''),
'From etc,etc,etc' (Title '')
From Tbl
;
.Export Reset

In SQL Assistant, go to Tools; Options; Export/ Import.
Clear the "Replace Carriage Returns In Column Data With Blanks".
Export the results to a file - you will get the carriage returns.

eg:

Select 'Show User '||'0d'XC||username (Title '')
From DBC.Users ;

Strongly suggest you set it back afterwards!