-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave-stmt.html
More file actions
64 lines (62 loc) · 2.64 KB
/
save-stmt.html
File metadata and controls
64 lines (62 loc) · 2.64 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
<!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>SAVE Statement - 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>SAVE</code> Statement</h1>Saves the notebook to disk.
<h2>Syntax</h2>
<p><tt>SAVE;</tt><tt><br></tt> <tt>SAVE <i>filename</i>;</tt><br></p>
<h2>Parameters</h2>
<ul class="args">
<li><i>filename</i>: text (optional)<br>
The path where the notebook should be saved. If not provided, the notebook is saved to its existing filename. If
the notebook is untitled and no filename is provided, an error is thrown.</li>
</ul>
<h2>Examples</h2>
<ul class="examples">
<li><code>SAVE 'C:\Data\my-notebook.sqlnb';</code><br>
Saves the notebook to the specified path.</li>
<li><code>SAVE;</code><br>
Saves the notebook to its existing filename. If the notebook is untitled, this will throw an error.</li>
</ul>
<h2>Remarks</h2>
<p>The <code>SAVE</code> statement is particularly useful in scripts to ensure changes are persisted to disk.</p>
<p><strong>Important:</strong> The <code>SAVE</code> statement only works outside of a transaction. If you have an
active transaction, <code>SAVE</code> will fail with an error. Because the SQL Notebook UI defaults script execution
to "Implicit BEGIN ... COMMIT" transaction mode, the <code>SAVE</code> command will produce an error when first
attempted in the UI. To use <code>SAVE</code> in the UI, you must change the transaction mode to "None (auto-commit)"
before executing your script.</p>
<p>This transaction limitation does not affect the <code>SqlNotebookCmd</code> command line tool, which does not use
implicit transactions.</p>
</div></article>
<footer><div id="footer">
<hr>
© 2016-2025 <a href="https://github.com/electroly">Brian Luft</a>
</div></footer>
</body>
</html>