Exporting UTF8 column names from DBC, using CHR(26) ^Z SUB char...

Database
Enthusiast

Exporting UTF8 column names from DBC, using CHR(26) ^Z SUB char...

I'm wanting to export list of UTF column names from DBC.TablesV. I want to ensure valid UTF8 characters that can be used for names within double quotes aren't used as my column delimiter. I looked at your list of valid UTF8 column name chars and the ONLY one that is not valid is CHR(26), 0x1A, ^Z or however you want to call it. All the rest can be used (including tabs and spaces). Also columns can now be up to 128 unicode letters long. I effectively need:

SELECT TableKind || CHR(26) || DatabaseName || CHR(26) || TableName

FROM DBC.TablesV

Now if I do this as a BTEQ REPORT file this will frustratingly replace CHR(26) with a space, because it was originally designed for printing reports. Hence now I'm back where I started - delimiting with valid column name chars. I'm desireous of not using fixed width DATA report but I'm not sure what else to do...

Ideas?

1 REPLY
Junior Contributor

Re: Exporting UTF8 column names from DBC, using CHR(26) ^Z SUB char...

But what are you going to do with this data?

Load it back to Teradata using BTEQ or a load utility?

Use it in a BTEQ .RUN?

There's the CHAR2HEXINT function to return the hex representation.

BTEQ DATA will not replace the substitute character.

Btw, the characters '001A' or 'FFFD' will return an error message as default, so your system seems to be modified to accept them...

Dieter