SQL-ftpd PUT command


Note: Your ftp client may be case sensitive

The PUT command is used to put data from a local file or dataset into a table on the remote SQL server. Since this is another the basic functionality commands of the SQL-ftpd server, it deserves a little more than a brief overview.

With a standard ftp session, you would issue a put command to transfer a file to the remote file system from a local file. You can specify a filename for the remote file, or if you leave it blank it will use the filename from the remote file system. However, under SQL-ftpd, this command is being mapped to a SQL server database and hence requires a few operating changes. A synopsis of those changes is given below:

A synopsis of the command is given below:

This will take the delimited data contained in the file named local-file-name and attempt to copy it into the table named sql-server table name on the remote sql server. There must be ((number of columns) - 1) delimiters for each row contained in the data file or else the put command will fail with an error. (There must be the same number of data fields in the file, as there are columns on the sql server table).

Note that the above synopsis assumes you've already issued a cd command to change to the appropriate database.

An example of this command's usage is given below:

In the preceeding example the file containing data named countries.txt was sent to the remote sql server. The data contained in the file was inserted (bulk copied, actually) into the table given by the nomenclature countries_tab, which is contained in the database nsyslaw. The messages confirm the names, confirm that the table was truncated before the insertion, and the number of rows copied into the table. A summary statistics report is sent following, which has no appreciable meaning (in our case).

You may also omit the remote file name, if your local file is the same name as your remote sql-server table. Further, you may also use the construct of db-name..table-name, for your remote table name, if you choose. If you have already changed to the database, the db-name..table-name construct is not necessary.

Again, note that the file must be delimited by some character. The delimiter is the tab character by default, but can be set to any printable character you wish through the use of the site command.


Forward to the append command manual page.
Return to the SQL-ftpd Commands Page