Bteq- Export file to a specific folder in user home directory

Tools & Utilities
Highlighted
Enthusiast

Bteq- Export file to a specific folder in user home directory

I want to export the output from sql query to a specific folder in user home directory in my Mac machine. 

My home directory woulld be: Users/{username}. So i want something like

 

.export file =/Users/{username}/A_Folder/

 

I have tried .export file = ~/A_Folder/ , but its not working. It is by default exporting the file to the path where the Bteq script exists.

Ofcourse, when I hardcode my username it would work fine, but I somehow I want to get that user home path.

 

Any help on how I can achieve this?

 

 

 

3 REPLIES 3
Teradata Employee

Re: Bteq- Export file to a specific folder in user home directory

Try quoting the file/path name

 

.export file="~/A_Folder/A_Filename"

 

Enthusiast

Re: Bteq- Export file to a specific folder in user home directory


@Fred wrote:

Try quoting the file/path name

 

.export file="~/A_Folder/A_Filename"

 


Thanks for the reply.  Unfortunately that didn't work out.

Is there any other way to make bteq to accept '~' symbol , so that I get the relative path?

 

Teradata Employee

Re: Bteq- Export file to a specific folder in user home directory

No. BTEQ does not recognize metacharacters (~, *, $var) in the filename and neither does the standard C library function it is using. 

You can use a relative path (i.e. . and ..) but not the sorts of expansion that would normally be done by the command-line shell.