-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist-files-func.html
More file actions
88 lines (86 loc) · 3.08 KB
/
list-files-func.html
File metadata and controls
88 lines (86 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>LIST_FILES Function - SQL Notebook</title>
<link rel="stylesheet" href="sqlnotebook.css">
</head>
<body>
<header>
<table class="nav">
<tr>
<td>
<a href="index.html"><img src="art/SqlNotebookIcon.png" alt="SQL Notebook (logo)" style="width: 58px; height: 58px; float: left; margin-right: 20px;"></a>
</td>
<td>
<a href="index.html" id="title">SQL Notebook</a><br>
<nav>
<ul class="nav">
<li><a href="https://github.com/brianluft/sqlnotebook/releases">Download</a></li>
<li><a href="doc.html"><span id="header-doc-long">Documentation</span><span id="header-doc-short">Docs</span></a></li>
<li><a href="https://github.com/brianluft/sqlnotebook">GitHub</a></li>
</ul>
</nav>
</td>
</tr>
</table>
<hr style="margin-top: 15px; margin-bottom: 15px;">
</header>
<article><div id="article">
<h1><code>LIST_FILES</code> Function</h1>
<p>Returns a table containing the files in a particular folder, optionally recursing into subfolders. If a folder
cannot be accessed, then it is skipped silently. This function is used in the <code>FROM</code> clause of a
<code>SELECT</code> statement and can participate in joins as if it were a table.</p>
<h2>Syntax</h2><code>LIST_FILES(<i>root-path</i>, [<i>recursive</i>])</code><br>
<h2>Parameters</h2>
<ul class="args">
<li><i>root-path</i>: text<br>
The absolute path of the folder on disk in which to search for files.</li>
<li><i>recursive</i>: integer (optional)<br>
If specified as non-zero, then all files in all subdirectories, recursively, will be returned.</li>
</ul>
<h2>Return Value</h2>
<blockquote>
A table with the following columns:
<table>
<thead>
<tr>
<th>Column name</th>
<th>Example value</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>file_path</code></td>
<td>"C:\Temp\file1.csv"</td>
</tr>
<tr>
<td><code>folder</code></td>
<td>"C:\Temp"</td>
</tr>
<tr>
<td><code>filename</code></td>
<td>"file1.csv"</td>
</tr>
<tr>
<td><code>extension</code></td>
<td>".csv"</td>
</tr>
<tr>
<td><code>modified_date</code></td>
<td>"2016-04-03 22:05:14.790 -04:00"</td>
</tr>
</tbody>
</table>
</blockquote>
<h2>Example</h2>
<pre><i>-- Returns a table listing all the files in the<br>-- root C:\ directory.</i><br>SELECT * FROM LIST_FILES('C:\');<br><br><i>-- Returns a table listing the first 50 file</i><i><br></i><i>-- paths in the C:\Users\ directory and all</i><i><br></i><i>-- subdirectories within it, recursively.</i><br>SELECT file_path FROM LIST_FILES('C:\Users\', 1) LIMIT 50;</pre>
<ul class="examples"></ul>
</div></article>
<footer><div id="footer">
<hr>
© 2016-2025 <a href="https://github.com/electroly">Brian Luft</a>
</div></footer>
</body>
</html>