TPT Job variable File - SelectStmt Variable using CRLF

Tools & Utilities
Highlighted
Teradata Employee

TPT Job variable File - SelectStmt Variable using CRLF

How can I structure a big SQL statement defined in the Job variable File with the SelectStmt Variable without getting an error when using Carriage Return LineFeeds

4 REPLIES
Teradata Employee

Re: TPT Job variable File - SelectStmt Variable using CRLF

Don't use them.  :)

Seriously, TPT does not parse the quoted strings in the job variable files. 

Thus, TPT cannot remove them.

And CRLF characters are not valid characters within Teradata requests.

Therefore, you should make sure that your request text does not have any CRLF characters.

-- SteveF
Teradata Employee

Re: TPT Job variable File - SelectStmt Variable using CRLF

Thank's! Makes a large SQL statement not really readable/serviceable/usable within TPT:-(

Teradata Employee

Re: TPT Job variable File - SelectStmt Variable using CRLF

Hi manfred_baur,

 

When I have queries, I indent them using pipes for readability :

, varchar SelectStmt  = ' select Column1'
                     || '      , to_char(Column2, ''YYYY-MM-DD HH:MI:SS'')'
                     || '      , Column3'
                     || '      , ''constant'' as Column4'
                     || '   from DatabaseName.ViewName'
                     || '  where Column5 = ''Something'';'

Don't forget to add a space between two lines.

 

Teradata Employee

Re: TPT Job variable File - SelectStmt Variable using CRLF

Thx Waldar, good hint! I'll try this.