Start a new topic

@CD and LOAD DATA LOCAL INFILE

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

The mySQL command "LOAD DATA LOCAL INFILE" will import a datafile located on the client machine. As the docs note, "if given as a relative path name, the name is interpreted relative to the directory in which the client program was started". And indeed, relative paths do seem to start from the directory the DbVisualizer app is located in (OSX, anyway). However, it would be very nice if the directory used as the relative base in these cases changed with the @CD command (which also starts at the DbVis directory, I think). That would allow something like: @CD /Users/me/scripts -- or @CD /Users/him/scripts on another setup @RUN someScript @RUN anotherScript LOAD DATA LOCAL INFILE 'data/myData.txt' INTO TABLE myTable; where /Users/me/scripts/data/myData.txt is the file to be loaded. This would allow the directory to be changed once, and no changes needed to the LOAD command if run on another machine with the same directory layout but with an account called "him" instead of "me". It is possible to do something like LOCAL INFILE '/Users/${username}$/scripts/data, but it would be nice if the @CD directory was also the relative start for LOCAL INFILE.

[This reply is migrated from our old forums.]

Re: @CD and LOAD DATA LOCAL INFILE
Hi David, Thanks for your suggestion. The @cd, @run and all other @xxx commands are DbVisualizer specific while for example "LOAD DATA..." is MySQL specific. The best we can offer based on this is to add support for a new ${pwd} (print working directory) variable that you can use to represent the current directory: LOAD DATA LOCAL INFILE '${pwd}/data/myData.txt' INTO TABLE myTable; Best Regards Roger
[This reply is migrated from our old forums.]

Re: @CD and LOAD DATA LOCAL INFILE
Hi, Just to inform that this is now fixed in the latest DbVisualizer 8.0 version. Regards Roger