Fork me on GitHub

TSVWrite

Signatures

TSVWrite(VARCHAR path, VARCHAR tableName);

Description

Save a table (tablename) into a Tab-Separated Values (TSV) file specified by path.

Example

In following example, we have a table called GameOfThrones and structured as follow.

SELECT * FROM GameOfThrones ;
-- Answer:
-- |   NAME    | FIRSTNAME |     PLACE      |
-- |-----------|-----------|----------------|
-- | Stark     | Arya      | Winterfell     |
-- | Lannister | Tyrion    | Westeros       |
-- | Snow      | Jon       | Castle Black   |
-- | Baelish   | Peter     | King's Landing |

Now we save this table into a .tsv file …

CALL TSVWrite('/home/user/GoT.tsv', 'GameOfThrones');

… and we can open this GoT.tsv file in a text editor

NAME	FIRSTNAME	PLACE
Stark	Arya	Winterfell
Lannister	Tyrion	Westeros
Snow	Jon	Castle Black
Baelish	Peter	King's Landing
See also