Start a new topic

Default directory for @export

[This topic is migrated from our old forums. The original author name has been removed]

On a Mac when using the @export command, if one fails to include a path in the "filename" parameter then the resulting file is written INSIDE the DbVisualizer application bundle (which is NOT a good place for it). I suspect that the Windows client is also using the DbVisualizer installation directory as the output path when none is specified, though I haven't confirmed this definitively yet. I'd like to request that the default output directory be the user's home directory, rather than the application installation directory. I'd also request that the output path be included in the messages on the SQL Commander "Log" tab in the case where a path hasn't been specified. It took me a while to figure out where DbVis had placed my output file. Thanks.

[This reply is migrated from our old forums.]

Re: Default directory for @export
Hi Steve, Thanks for the suggestions. I agree with you that showing the absolute path in the log message would be helpful and I have opened a ticket for that suggestion. Regarding the default directory, I agree that e.g. the user's home directory would be a better choice but it has been like this forever so we need to be a bit more careful about changing the behavior. A simple solution available today is to put a @cd command at the top of your export script to change the default to what you want it to be. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Default directory for @export
> {quote:title=Hans Bergsten wrote:}{quote} > ... > Regarding the default directory, I agree that e.g. the user's home directory would be a better choice but it has been like this forever so we need to be a bit more careful about changing the behavior. A simple solution available today is to put a @cd command at the top of your export script to change the default to what you want it to be. Using the @cd command doesn't seem to make a difference. The output file still ends up within the application bundle. Is there a way to reference the user's home directory with a pre-defined variable? Sometimes I develop a script on my Mac and then later run it on a client's Windows machine. It would be nice not to have to hard-code the full file path.
[This reply is migrated from our old forums.]

Re: Default directory for @export
Hi Steve, Sorry, I was sure that the @cd command changed the default directory also for the @export command but I was wrong. I think it should so I have opened a ticket on this. I have also opened a ticket for adding a pre-defined variable to hold the user's home directory. There is another predefined variable ($dbvis-pwd}$) that holds the current directory set by the @cd command, and you can use it like this for the @export file names: @cd /Users/hans; @export on; @export set Filename="${dbvis-pwd}$/foo.csv"; I hope this is a workable solution for you. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Default directory for @export
Sure, that works. It still requires hard-coding the directory, though, in which case I could accomplish the same thing by putting the output directory into a variable at the top of the script: @echo "Output directory = ${outdir||/Users/steve||String||noshow}$"; @export on; @export set Filename="${outdir}$/foo.csv"; Personally, I find this more intuitive and it allows me to put the configurable items at the start of my script. Thanks for your assistance.

Just to let you know DbVisualizer 9.5.3 has been released fixing this.