@sap/async-xsjs 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/LICENSE +37 -0
  3. package/README.md +445 -0
  4. package/differences.md +162 -0
  5. package/docs/$.Application.html +262 -0
  6. package/docs/$.Session.html +674 -0
  7. package/docs/$.db.CallableStatement.html +2524 -0
  8. package/docs/$.db.Connection.html +511 -0
  9. package/docs/$.db.ParameterMetaData.html +805 -0
  10. package/docs/$.db.PreparedStatement.html +1796 -0
  11. package/docs/$.db.ResultSet.html +1308 -0
  12. package/docs/$.db.ResultSetMetaData.html +800 -0
  13. package/docs/$.db.SQLException.html +259 -0
  14. package/docs/$.db.html +773 -0
  15. package/docs/$.hdb.ColumnMetadata.html +438 -0
  16. package/docs/$.hdb.Connection.html +663 -0
  17. package/docs/$.hdb.ProcedureResult.html +280 -0
  18. package/docs/$.hdb.ResultSet.html +324 -0
  19. package/docs/$.hdb.ResultSetIterator.html +315 -0
  20. package/docs/$.hdb.ResultSetMetaData.html +259 -0
  21. package/docs/$.hdb.SQLException.html +259 -0
  22. package/docs/$.hdb.html +557 -0
  23. package/docs/$.html +471 -0
  24. package/docs/$.jobs.Job.html +783 -0
  25. package/docs/$.jobs.JobLog.html +380 -0
  26. package/docs/$.jobs.JobSchedules.html +852 -0
  27. package/docs/$.jobs.html +238 -0
  28. package/docs/$.net.Destination.html +304 -0
  29. package/docs/$.net.Mail.Part.html +510 -0
  30. package/docs/$.net.Mail.html +504 -0
  31. package/docs/$.net.SMTPConnection.html +347 -0
  32. package/docs/$.net.html +749 -0
  33. package/docs/$.net.http.Client.html +562 -0
  34. package/docs/$.net.http.Destination.html +237 -0
  35. package/docs/$.net.http.Request.html +567 -0
  36. package/docs/$.net.http.html +292 -0
  37. package/docs/$.security.AntiVirus.html +361 -0
  38. package/docs/$.security.Store.html +636 -0
  39. package/docs/$.security.crypto.html +414 -0
  40. package/docs/$.security.html +247 -0
  41. package/docs/$.security.x509.html +373 -0
  42. package/docs/$.text.analysis.Session.html +983 -0
  43. package/docs/$.text.analysis.html +242 -0
  44. package/docs/$.text.html +246 -0
  45. package/docs/$.text.mining.Session.html +2018 -0
  46. package/docs/$.text.mining.html +242 -0
  47. package/docs/$.trace.html +525 -0
  48. package/docs/$.util.SAXParser.html +955 -0
  49. package/docs/$.util.Zip.html +474 -0
  50. package/docs/$.util.codec.html +414 -0
  51. package/docs/$.util.compression.html +357 -0
  52. package/docs/$.util.html +325 -0
  53. package/docs/$.util.sql.html +290 -0
  54. package/docs/$.web.Body.html +333 -0
  55. package/docs/$.web.EntityList.html +296 -0
  56. package/docs/$.web.TupelList.html +496 -0
  57. package/docs/$.web.WebEntityRequest.html +393 -0
  58. package/docs/$.web.WebEntityResponse.html +392 -0
  59. package/docs/$.web.WebRequest.html +560 -0
  60. package/docs/$.web.WebResponse.html +609 -0
  61. package/docs/$.web.html +246 -0
  62. package/docs/Copyright-SAP.html +39 -0
  63. package/docs/Disclaimer-SAP.html +55 -0
  64. package/docs/index.html +232 -0
  65. package/docs/styles/jsdoc-default.css +382 -0
  66. package/lib/AppConfig.js +36 -0
  67. package/lib/AuditLogger.js +41 -0
  68. package/lib/cacert.js +26 -0
  69. package/lib/ctypes.js +153 -0
  70. package/lib/destinations/dest-provider.js +57 -0
  71. package/lib/index.js +235 -0
  72. package/lib/jobs/Action.js +40 -0
  73. package/lib/jobs/Job.js +100 -0
  74. package/lib/jobs/JobManager.js +150 -0
  75. package/lib/jobs/JobsRuntime.js +133 -0
  76. package/lib/jobs/SqlScriptJobRunner.js +36 -0
  77. package/lib/jobs/XsjsJobRunner.js +78 -0
  78. package/lib/jobs/index.js +11 -0
  79. package/lib/logging.js +16 -0
  80. package/lib/middleware.js +125 -0
  81. package/lib/odata/ODataService.js +125 -0
  82. package/lib/odata/index.js +7 -0
  83. package/lib/odata/service-factory.js +26 -0
  84. package/lib/passport-noauth.js +17 -0
  85. package/lib/routes.js +115 -0
  86. package/lib/runtime.js +740 -0
  87. package/lib/sandbox.js +40 -0
  88. package/lib/utils/XsJsFunctionRunner.js +57 -0
  89. package/lib/utils/XsJsLibFunctionRunner.js +57 -0
  90. package/lib/utils/buffer-utils.js +77 -0
  91. package/lib/utils/compression-utils.js +14 -0
  92. package/lib/utils/date-utils.js +104 -0
  93. package/lib/utils/errors/HttpError.js +20 -0
  94. package/lib/utils/errors/wrap-app-error.js +18 -0
  95. package/lib/utils/index.js +17 -0
  96. package/lib/utils/xs-function-runner.js +51 -0
  97. package/lib/utils/xs-types.js +21 -0
  98. package/lib/utils/xspath.js +36 -0
  99. package/lib/utils/xsstack.js +28 -0
  100. package/lib/views/error.html +28 -0
  101. package/lib/xsjs/Application.js +28 -0
  102. package/lib/xsjs/Locale.js +53 -0
  103. package/lib/xsjs/Session.js +31 -0
  104. package/lib/xsjs/constants.js +71 -0
  105. package/lib/xsjs/db/common/DbBase.js +85 -0
  106. package/lib/xsjs/db/common/DbOptions.js +163 -0
  107. package/lib/xsjs/db/common/arguments-validation.js +102 -0
  108. package/lib/xsjs/db/common/connection.js +12 -0
  109. package/lib/xsjs/db/common/enums.js +93 -0
  110. package/lib/xsjs/db/common/execute-batch.js +38 -0
  111. package/lib/xsjs/db/common/parse-time.js +139 -0
  112. package/lib/xsjs/db/dbapi/CallableStatement.js +192 -0
  113. package/lib/xsjs/db/dbapi/Connection.js +78 -0
  114. package/lib/xsjs/db/dbapi/DB.js +39 -0
  115. package/lib/xsjs/db/dbapi/ParameterMetaData.js +118 -0
  116. package/lib/xsjs/db/dbapi/PreparedStatement.js +78 -0
  117. package/lib/xsjs/db/dbapi/ResultSet.js +220 -0
  118. package/lib/xsjs/db/dbapi/ResultSetMetaData.js +116 -0
  119. package/lib/xsjs/db/dbapi/Statement.js +514 -0
  120. package/lib/xsjs/db/dbapi/conversions.js +113 -0
  121. package/lib/xsjs/db/dbapi/fetch-rows.js +32 -0
  122. package/lib/xsjs/db/hdbapi/Connection.js +525 -0
  123. package/lib/xsjs/db/hdbapi/HDB.js +32 -0
  124. package/lib/xsjs/db/hdbapi/ResultSetIterator.js +40 -0
  125. package/lib/xsjs/db/hdbapi/convert.js +77 -0
  126. package/lib/xsjs/db/hdbapi/table-string-parser.js +52 -0
  127. package/lib/xsjs/db/index.js +4 -0
  128. package/lib/xsjs/index.js +13 -0
  129. package/lib/xsjs/jobs/Job.js +228 -0
  130. package/lib/xsjs/jobs/Jobs.js +11 -0
  131. package/lib/xsjs/jobs/Logs.js +127 -0
  132. package/lib/xsjs/jobs/Schedule.js +110 -0
  133. package/lib/xsjs/jobs/Schedules.js +108 -0
  134. package/lib/xsjs/net/Destination.js +43 -0
  135. package/lib/xsjs/net/http/Client.js +220 -0
  136. package/lib/xsjs/net/http/HTTP.js +72 -0
  137. package/lib/xsjs/net/index.js +5 -0
  138. package/lib/xsjs/net/smtp/Mail.js +38 -0
  139. package/lib/xsjs/net/smtp/Part.js +30 -0
  140. package/lib/xsjs/net/smtp/SMTPConnection.js +39 -0
  141. package/lib/xsjs/net/smtp/index.js +18 -0
  142. package/lib/xsjs/net/smtp/nodemailer-util.js +77 -0
  143. package/lib/xsjs/require.js +39 -0
  144. package/lib/xsjs/security/AntiVirus.js +31 -0
  145. package/lib/xsjs/security/Store.js +119 -0
  146. package/lib/xsjs/security/crypto.js +23 -0
  147. package/lib/xsjs/security/index.js +5 -0
  148. package/lib/xsjs/security/x509.js +12 -0
  149. package/lib/xsjs/text/analysis/Session.js +128 -0
  150. package/lib/xsjs/text/index.js +30 -0
  151. package/lib/xsjs/text/mining/Session.js +82 -0
  152. package/lib/xsjs/trace/trace.js +41 -0
  153. package/lib/xsjs/util/SAXParser.js +174 -0
  154. package/lib/xsjs/util/Zip.js +220 -0
  155. package/lib/xsjs/util/codec.js +33 -0
  156. package/lib/xsjs/util/compression.js +24 -0
  157. package/lib/xsjs/util/index.js +22 -0
  158. package/lib/xsjs/web/BasicWebEntity.js +41 -0
  159. package/lib/xsjs/web/EntityList.js +11 -0
  160. package/lib/xsjs/web/TupelLists/CookiesTupelList.js +47 -0
  161. package/lib/xsjs/web/TupelLists/HeadersTupelList.js +55 -0
  162. package/lib/xsjs/web/TupelLists/ParametersTupelList.js +83 -0
  163. package/lib/xsjs/web/TupelLists/TupelListBase.js +45 -0
  164. package/lib/xsjs/web/WebBody.js +135 -0
  165. package/lib/xsjs/web/WebEntityRequest.js +40 -0
  166. package/lib/xsjs/web/WebEntityResponse.js +26 -0
  167. package/lib/xsjs/web/WebRequest.js +209 -0
  168. package/lib/xsjs/web/WebResponse.js +183 -0
  169. package/lib/xsjs/web/index.js +4 -0
  170. package/lib/xsjs/web/utils/HeadersParser.js +53 -0
  171. package/lib/xsjs/web/utils/HttpRequestParser.js +93 -0
  172. package/lib/xsjs/web/utils/MultipartParser.js +163 -0
  173. package/lib/xsjs/web/utils/MultipartResponseBuilder.js +73 -0
  174. package/lib/xsjs/web/utils/SetCookieParser.js +32 -0
  175. package/lib/xsjslib/TextBundleWrapper.js +46 -0
  176. package/lib/xsjslib/index.js +11 -0
  177. package/npm-shrinkwrap.json +11540 -0
  178. package/package.json +84 -0
@@ -0,0 +1,663 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>JSDoc: Class: Connection</title>
7
+ <script src="scripts/prettify/prettify.js"></script>
8
+ <script src="scripts/prettify/lang-css.js"></script>
9
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
10
+
11
+
12
+ <script src="scripts/launch-8b3c5ca29b9e.min.js"></script>
13
+ <script src="scripts/highlight.js"></script>
14
+
15
+ <link rel="canonical" href="$.hdb.Connection.html">
16
+ </head>
17
+ <body>
18
+ <div id="main">
19
+ <h1 class="page-title">Class: Connection</h1>
20
+ <section>
21
+ <header>
22
+ <h2>
23
+ <span class="ancestors"><a href="$.html">$</a><a href="$.hdb.html">.hdb</a>.</span>
24
+ Connection
25
+ </h2>
26
+ <div class="class-description">HANA database connection.</div>
27
+ </header>
28
+ <article>
29
+ <div class="container-overview">
30
+ <dt>
31
+ <h4 class="name" id="Connection"><span class="type-signature"></span>new Connection<span
32
+ class="signature">()</span><span class="type-signature"></span></h4>
33
+ </dt>
34
+ <dd>
35
+ <dl class="details">
36
+ </dl>
37
+ </dd>
38
+ </div>
39
+ <h3 class="subsection-title">Methods</h3>
40
+ <dl>
41
+ <dt>
42
+ <h4 class="name" id="close"><span class="type-signature">async </span>close<span
43
+ class="signature">()</span><span class="type-signature"></span></h4>
44
+ </dt>
45
+ <dd>
46
+ <div class="description">
47
+ Closes the connection
48
+ </div>
49
+ <dl class="details">
50
+ </dl>
51
+ <h5>Throws:</h5>
52
+ <dl>
53
+ <dt>
54
+ <div class="param-desc">
55
+ Throws an error if the operation fails.
56
+ </div>
57
+ </dt>
58
+ <dt>
59
+ <dl>
60
+ <dt>
61
+ Type
62
+ </dt>
63
+ <dd>
64
+ <span class="param-type"><a
65
+ href="$.hdb.SQLException.html">$.hdb.SQLException</a></span>
66
+ </dd>
67
+ </dl>
68
+ </dt>
69
+ </dl>
70
+ </dd>
71
+ <dt>
72
+ <h4 class="name" id="commit"><span class="type-signature">async </span>commit<span
73
+ class="signature">()</span><span class="type-signature"></span></h4>
74
+ </dt>
75
+ <dd>
76
+ <div class="description">
77
+ Commits the changes and ends the current transaction. <b>By default autocommit mode is disabled,
78
+ which means all database changes must be explicitly commited.</b>
79
+ </div>
80
+ <dl class="details">
81
+ </dl>
82
+ <h5>Throws:</h5>
83
+ <dl>
84
+ <dt>
85
+ <div class="param-desc">
86
+ Throws an error if the operation fails.
87
+ </div>
88
+ </dt>
89
+ <dt>
90
+ <dl>
91
+ <dt>
92
+ Type
93
+ </dt>
94
+ <dd>
95
+ <span class="param-type"><a
96
+ href="$.hdb.SQLException.html">$.hdb.SQLException</a></span>
97
+ </dd>
98
+ </dl>
99
+ </dt>
100
+ </dl>
101
+ <h5>Example</h5>
102
+ <pre class="prettyprint"><code>var connection = <b>await </b>$.hdb.getConnection();
103
+ <b>await </b>connection.executeUpdate('UPDATE "DB_EXAMPLE"."ICECREAM" SET QUANTITY=? WHERE FLAVOR=?', 9, 'CHOCOLATE');
104
+ <b>await </b>connection.commit();</code></pre>
105
+ </dd>
106
+ <dt>
107
+ <h4 class="name" id="executeQuery"><span class="type-signature">async </span>executeQuery<span
108
+ class="signature">(query, <span class="optional">arguments</span>)</span><span
109
+ class="type-signature"> &rarr; {<a href="$.hdb.ResultSet.html">$.hdb.ResultSet</a>}</span>
110
+ </h4>
111
+ </dt>
112
+ <dd>
113
+ <div class="description">
114
+ Executes a database query. The query string is prepared and the additional arguments are applied
115
+ as statement parameters, before the statement is executed.
116
+ </div>
117
+ <h5>Parameters:</h5>
118
+ <table class="params">
119
+ <thead>
120
+ <tr>
121
+ <th>Name</th>
122
+ <th>Type</th>
123
+ <th>Argument</th>
124
+ <th class="last">Description</th>
125
+ </tr>
126
+ </thead>
127
+ <tbody>
128
+ <tr>
129
+ <td class="name"><code>query</code></td>
130
+ <td class="type">
131
+ <span class="param-type">string</span>
132
+ </td>
133
+ <td class="attributes">
134
+ </td>
135
+ <td class="description last">The query string to be executed.</td>
136
+ </tr>
137
+ <tr>
138
+ <td class="name"><code>arguments</code></td>
139
+ <td class="type">
140
+ <span class="param-type">any</span>
141
+ </td>
142
+ <td class="attributes">
143
+ &lt;optional><br>
144
+ &lt;repeatable><br>
145
+ </td>
146
+ <td class="description last">Variable number of arguments to be bound to the query
147
+ parameters.
148
+ </td>
149
+ </tr>
150
+ </tbody>
151
+ </table>
152
+ <dl class="details">
153
+ </dl>
154
+ <h5>Throws:</h5>
155
+ <dl>
156
+ <dt>
157
+ <div class="param-desc">
158
+ Throws an error if the statement cannot be executed.
159
+ </div>
160
+ </dt>
161
+ <dt>
162
+ <dl>
163
+ <dt>
164
+ Type
165
+ </dt>
166
+ <dd>
167
+ <span class="param-type"><a
168
+ href="$.hdb.SQLException.html">$.hdb.SQLException</a></span>
169
+ </dd>
170
+ </dl>
171
+ </dt>
172
+ </dl>
173
+ <h5>Returns:</h5>
174
+ <dl>
175
+ <dt>
176
+ Type
177
+ </dt>
178
+ <dd>
179
+ <span class="param-type"><a href="$.hdb.ResultSet.html">$.hdb.ResultSet</a></span>
180
+ </dd>
181
+ </dl>
182
+ <h5>Example</h5>
183
+ <pre class="prettyprint"><code>var connection = <b>await </b>$.hdb.getConnection();
184
+ <b>await </b>connection.executeQuery('SELECT * FROM "DB_EXAMPLE"."ICECREAM"');
185
+ <b>await </b>connection.executeQuery('SELECT * FROM "DB_EXAMPLE"."ICECREAM" WHERE FLAVOR = ?', 'CHOCOLATE');
186
+ <b>await </b>connection.executeQuery('SELECT * FROM "DB_EXAMPLE"."ICECREAM" WHERE FLAVOR = ? AND PRICE < ?', 'STRAWBERRY', 2.50);</code></pre>
187
+ </dd>
188
+ <dt>
189
+ <h4 class="name" id="executeUpdate"><span class="type-signature">async </span>executeUpdate<span
190
+ class="signature">(statement, <span class="optional">arguments</span>)</span><span
191
+ class="type-signature"> &rarr; {number|array}</span></h4>
192
+ </dt>
193
+ <dd>
194
+ <div class="description">
195
+ Executes a SQL statement, which changes the database state. SELECT and CALL statements are not
196
+ allowed here. The query string is prepared and the additional arguments are applied as statement
197
+ parameters, before the statement is executed.
198
+ </div>
199
+ <h5>Parameters:</h5>
200
+ <table class="params">
201
+ <thead>
202
+ <tr>
203
+ <th>Name</th>
204
+ <th>Type</th>
205
+ <th>Argument</th>
206
+ <th class="last">Description</th>
207
+ </tr>
208
+ </thead>
209
+ <tbody>
210
+ <tr>
211
+ <td class="name"><code>statement</code></td>
212
+ <td class="type">
213
+ <span class="param-type">string</span>
214
+ </td>
215
+ <td class="attributes">
216
+ </td>
217
+ <td class="description last">The statement to be executed.</td>
218
+ </tr>
219
+ <tr>
220
+ <td class="name"><code>arguments</code></td>
221
+ <td class="type">
222
+ <span class="param-type">any</span>
223
+ </td>
224
+ <td class="attributes">
225
+ &lt;optional><br>
226
+ &lt;repeatable><br>
227
+ </td>
228
+ <td class="description last">Variable number of arguments to be bound to the query
229
+ parameters.
230
+ </td>
231
+ </tr>
232
+ </tbody>
233
+ </table>
234
+ <dl class="details">
235
+ </dl>
236
+ <h5>Throws:</h5>
237
+ <dl>
238
+ <dt>
239
+ <div class="param-desc">
240
+ Throws an error if the statement cannot be executed.
241
+ </div>
242
+ </dt>
243
+ <dt>
244
+ <dl>
245
+ <dt>
246
+ Type
247
+ </dt>
248
+ <dd>
249
+ <span class="param-type"><a
250
+ href="$.hdb.SQLException.html">$.hdb.SQLException</a></span>
251
+ </dd>
252
+ </dl>
253
+ </dt>
254
+ </dl>
255
+ <h5>Returns:</h5>
256
+ <div class="param-desc">
257
+ Number of affected rows | Array of numbers in case of batch update.
258
+ </div>
259
+ <dl>
260
+ <dt>
261
+ Type
262
+ </dt>
263
+ <dd>
264
+ <span class="param-type">number</span>
265
+ |
266
+ <span class="param-type">array</span>
267
+ </dd>
268
+ </dl>
269
+ <h5>Example</h5>
270
+ <pre class="prettyprint"><code>var connection = <b>await </b>$.hdb.getConnection();
271
+ <b>await </b>connection.executeUpdate('INSERT INTO "DB_EXAMPLE"."ICECREAM" VALUES (?,?,?)','STRAWBERRY', 2.50, 64.18);
272
+ <b>await </b>connection.executeUpdate('UPDATE "DB_EXAMPLE"."CASH" SET INCOME=?', 64.18);
273
+ <b>await </b>connection.executeUpdate('DELETE FROM "DB_EXAMPLE"."ICECREAM" WHERE FLAVOR = ?', 'STRAWBERRY');
274
+
275
+ //Batch Insert
276
+ var argsArray = [["MINT", 3.50, 34.5], ["VANILLA", 2.50, 23.6], ["CHERRY", 4.50, 67.9]];
277
+ <b>await </b>connection.executeUpdate('INSERT INTO "DB_EXAMPLE"."ICECREAM" VALUES (?,?,?)', argsArray)
278
+ <b>await </b>connection.commit();</code></pre>
279
+ </dd>
280
+ <dt>
281
+ <h4 class="name" id="getLastWarning"><span class="type-signature"></span>getLastWarning<span
282
+ class="signature">()</span><span class="type-signature"> &rarr; {Object|null}</span></h4>
283
+ </dt>
284
+ <dd>
285
+ <div class="description">
286
+ Returns the warning of the most recently executed statement.
287
+ </div>
288
+ <dl class="details">
289
+ </dl>
290
+ <h5>Throws:</h5>
291
+ <dl>
292
+ <dt>
293
+ <div class="param-desc">
294
+ Throws an error if the operation fails.
295
+ </div>
296
+ </dt>
297
+ <dt>
298
+ <dl>
299
+ <dt>
300
+ Type
301
+ </dt>
302
+ <dd>
303
+ <span class="param-type"><a
304
+ href="$.hdb.SQLException.html">$.hdb.SQLException</a></span>
305
+ </dd>
306
+ </dl>
307
+ </dt>
308
+ </dl>
309
+ <h5>Returns:</h5>
310
+ <div class="param-desc">
311
+ The return value has two properties: 'code' and 'message'.
312
+ 'null' is returned if the most recent statement didn't issue a warning.
313
+ </div>
314
+ <dl>
315
+ <dt>
316
+ Type
317
+ </dt>
318
+ <dd>
319
+ <span class="param-type">Object</span>
320
+ |
321
+ <span class="param-type">null</span>
322
+ </dd>
323
+ </dl>
324
+ </dd>
325
+ <dt>
326
+ <h4 class="name" id="loadProcedure"><span class="type-signature">async</span> loadProcedure<span
327
+ class="signature">(schema, procedure)</span><span
328
+ class="type-signature"> &rarr; {async function}</span></h4>
329
+ </dt>
330
+ <dd>
331
+ <div class="description">
332
+ Returns a JavaScript function representing the stored procedure being loaded.
333
+ </div>
334
+ <h5>Parameters:</h5>
335
+ <table class="params">
336
+ <thead>
337
+ <tr>
338
+ <th>Name</th>
339
+ <th>Type</th>
340
+ <th class="last">Description</th>
341
+ </tr>
342
+ </thead>
343
+ <tbody>
344
+ <tr>
345
+ <td class="name"><code>schema</code></td>
346
+ <td class="type">
347
+ <span class="param-type">string</span>
348
+ </td>
349
+ <td class="description last">The schema to which the procedure belongs.</td>
350
+ </tr>
351
+ <tr>
352
+ <td class="name"><code>procedure</code></td>
353
+ <td class="type">
354
+ <span class="param-type">string</span>
355
+ </td>
356
+ <td class="description last">The name of the procedure.</td>
357
+ </tr>
358
+ </tbody>
359
+ </table>
360
+ <dl class="details">
361
+ </dl>
362
+ <h5>Returns:</h5>
363
+ <dl>
364
+ <dt>
365
+ Type
366
+ </dt>
367
+ <dd>
368
+ <span class="param-type">function</span>
369
+ </dd>
370
+ </dl>
371
+ <h5>Examples</h5>
372
+ <pre class="prettyprint"><code>var connection = <b>await </b>$.hdb.getConnection();
373
+ // the procedure has signature 'DB_EXAMPLE'.'icecream.shop::sell'(IN flavor VARCHAR, IN quantity INTEGER, IN payment DECIMAL, OUT change DECIMAL)
374
+ var fnSell = <b>await </b>connection.loadProcedure('DB_EXAMPLE', 'icecream.shop::sell');
375
+ // call the procedure just like calling a javascript function
376
+ // sell three ice cream cups with chocolate flavor for 20 bucks each
377
+ var result = <b>await </b>fnSell('CHOCOLATE', 3, 20.00);
378
+ // alternatively use named parameters
379
+ var result = <b>await </b>fnSell({flavor: 'CHOCOLATE', quantity: 3, payment: 20.00});
380
+ // result is a $.hdb.ProcedureResult object</code></pre>
381
+ <pre class="prettyprint"><code><b><font
382
+ size="4">Table Parameter Support For Stored Procedures</font></b>
383
+
384
+ // the procedure has signature 'DB_EXAMPLE'.'icecream.shop::lower_price_by'(IN ice_cream_prices prices_table_type, IN lower_price_by DOUBLE, OUT new_ice_cream_prices prices_table_type)
385
+ var fnlowerPrice = <b>await </b>connection.loadProcedure('DB_EXAMPLE', 'icecream.shop::lower_price_by');
386
+
387
+ // passing a $.hdb.ResultSet object
388
+ var price_list = <b>await </b>connection.executeQuery('SELECT * FROM "DB_EXAMPLE"."SOLD_FLAVORS_PRICES"');
389
+ var result = <b>await </b>fnlowerPrice(price_list, 1.50);
390
+
391
+ // passing a string containing the name of existing table in the database
392
+ var result = <b>await </b>fnlowerPrice('"DB_EXAMPLE"."SOLD_FLAVORS_PRICES"', 1.50);
393
+
394
+ // passing an array of JSON objects representing the rows in the table
395
+ var price_list = [{flavor: 'STRAWBERRY', price: 4.50}, {flavor : 'VANILLA', price: 3.50}, {flavor: 'CHOCOLATE', price: 5.50}];
396
+ var result = <b>await </b>fnlowerPrice(price_list, 1.50);
397
+
398
+ // We can get the table output parameter "new_ice_cream_prices" like any other output parameter:
399
+ var new_price_list = result.new_ice_cream_prices;
400
+ // new_price_list is a $.hdb.ResultSet object</code></pre>
401
+ </dd>
402
+ <dt>
403
+ <h4 class="name" id="rollback"><span class="type-signature">async </span>rollback<span class="signature">()</span><span
404
+ class="type-signature"></span></h4>
405
+ </dt>
406
+ <dd>
407
+ <div class="description">
408
+ Reverts the changes and ends the current transaction.
409
+ </div>
410
+ <dl class="details">
411
+ </dl>
412
+ <h5>Throws:</h5>
413
+ <dl>
414
+ <dt>
415
+ <div class="param-desc">
416
+ Throws an error if the operation fails.
417
+ </div>
418
+ </dt>
419
+ <dt>
420
+ <dl>
421
+ <dt>
422
+ Type
423
+ </dt>
424
+ <dd>
425
+ <span class="param-type"><a
426
+ href="$.hdb.SQLException.html">$.hdb.SQLException</a></span>
427
+ </dd>
428
+ </dl>
429
+ </dt>
430
+ </dl>
431
+ <h5>Example</h5>
432
+ <pre class="prettyprint"><code>var connection = <b>await </b>$.hdb.getConnection();
433
+ <b>await </b>connection.executeUpdate('UPDATE "DB_EXAMPLE"."ICECREAM" SET QUANTITY=? WHERE FLAVOR=?', 9, 'CHOCOLATE');
434
+ <b>await </b>connection.rollback();</code></pre>
435
+ </dd>
436
+ <dt>
437
+ <h4 class="name" id="setAutoCommit"><span class="type-signature"></span>setAutoCommit<span
438
+ class="signature">(enable)</span><span class="type-signature"></span></h4>
439
+ </dt>
440
+ <dd>
441
+ <div class="description">
442
+ Changes the auto-commit flag of the connection.
443
+ </div>
444
+ <h5>Parameters:</h5>
445
+ <table class="params">
446
+ <thead>
447
+ <tr>
448
+ <th>Name</th>
449
+ <th>Type</th>
450
+ <th class="last">Description</th>
451
+ </tr>
452
+ </thead>
453
+ <tbody>
454
+ <tr>
455
+ <td class="name"><code>enable</code></td>
456
+ <td class="type">
457
+ <span class="param-type">number</span>
458
+ </td>
459
+ <td class="description last">A number value, which can be either 0 (false) or 1 (true)</td>
460
+ </tr>
461
+ </tbody>
462
+ </table>
463
+ <dl class="details">
464
+ </dl>
465
+ </dd>
466
+ </dl>
467
+ </article>
468
+ </section>
469
+ </div>
470
+ <nav>
471
+ <h2><a href="index.html">Index</a></h2>
472
+ <h3>Classes</h3>
473
+ <table>
474
+ <tr>
475
+ <td><a href="$.security.AntiVirus.html">AntiVirus</a></td>
476
+ <td class="oblique">$.security</td>
477
+ </tr>
478
+ <tr>
479
+ <td><a href="$.Application.html">Application</a></td>
480
+ <td class="oblique">$</td>
481
+ </tr>
482
+ <tr>
483
+ <td><a href="$.web.Body.html">Body</a></td>
484
+ <td class="oblique">$.web</td>
485
+ </tr>
486
+ <tr>
487
+ <td><a href="$.db.CallableStatement.html">CallableStatement</a></td>
488
+ <td class="oblique">$.db</td>
489
+ </tr>
490
+ <tr>
491
+ <td><a href="$.net.http.Client.html">Client</a></td>
492
+ <td class="oblique">$.net.http</td>
493
+ </tr>
494
+ <tr>
495
+ <td><a href="$.hdb.ColumnMetadata.html">ColumnMetadata</a></td>
496
+ <td class="oblique">$.hdb</td>
497
+ </tr>
498
+ <tr>
499
+ <td><a href="$.db.Connection.html">Connection</a></td>
500
+ <td class="oblique">$.db</td>
501
+ </tr>
502
+ <tr>
503
+ <td><a href="$.hdb.Connection.html">Connection</a></td>
504
+ <td class="oblique">$.hdb</td>
505
+ </tr>
506
+ <tr>
507
+ <td><a href="$.net.Destination.html">Destination</a></td>
508
+ <td class="oblique">$.net</td>
509
+ </tr>
510
+ <tr>
511
+ <td><a href="$.net.http.Destination.html">Destination</a></td>
512
+ <td class="oblique">$.net.http</td>
513
+ </tr>
514
+ <tr>
515
+ <td><a href="$.web.EntityList.html">EntityList</a></td>
516
+ <td class="oblique">$.web</td>
517
+ </tr>
518
+ <tr>
519
+ <td><a href="$.jobs.Job.html">Job</a></td>
520
+ <td class="oblique">$.jobs</td>
521
+ </tr>
522
+ <tr>
523
+ <td><a href="$.jobs.JobLog.html">JobLog</a></td>
524
+ <td class="oblique">$.jobs</td>
525
+ </tr>
526
+ <tr>
527
+ <td><a href="$.jobs.JobSchedules.html">JobSchedules</a></td>
528
+ <td class="oblique">$.jobs</td>
529
+ </tr>
530
+ <tr>
531
+ <td><a href="$.net.Mail.html">Mail</a></td>
532
+ <td class="oblique">$.net</td>
533
+ </tr>
534
+ <tr>
535
+ <td><a href="$.db.ParameterMetaData.html">ParameterMetaData</a></td>
536
+ <td class="oblique">$.db</td>
537
+ </tr>
538
+ <tr>
539
+ <td><a href="$.net.Mail.Part.html">Part</a></td>
540
+ <td class="oblique">$.net.Mail</td>
541
+ </tr>
542
+ <tr>
543
+ <td><a href="$.db.PreparedStatement.html">PreparedStatement</a></td>
544
+ <td class="oblique">$.db</td>
545
+ </tr>
546
+ <tr>
547
+ <td><a href="$.hdb.ProcedureResult.html">ProcedureResult</a></td>
548
+ <td class="oblique">$.hdb</td>
549
+ </tr>
550
+ <tr>
551
+ <td><a href="$.net.http.Request.html">Request</a></td>
552
+ <td class="oblique">$.net.http</td>
553
+ </tr>
554
+ <tr>
555
+ <td><a href="$.db.ResultSet.html">ResultSet</a></td>
556
+ <td class="oblique">$.db</td>
557
+ </tr>
558
+ <tr>
559
+ <td><a href="$.hdb.ResultSet.html">ResultSet</a></td>
560
+ <td class="oblique">$.hdb</td>
561
+ </tr>
562
+ <tr>
563
+ <td><a href="$.hdb.ResultSetIterator.html">ResultSetIterator</a></td>
564
+ <td class="oblique">$.hdb</td>
565
+ </tr>
566
+ <tr>
567
+ <td><a href="$.db.ResultSetMetaData.html">ResultSetMetaData</a></td>
568
+ <td class="oblique">$.db</td>
569
+ </tr>
570
+ <tr>
571
+ <td><a href="$.hdb.ResultSetMetaData.html">ResultSetMetaData</a></td>
572
+ <td class="oblique">$.hdb</td>
573
+ </tr>
574
+ <tr>
575
+ <td><a href="$.util.SAXParser.html">SAXParser</a></td>
576
+ <td class="oblique">$.util</td>
577
+ </tr>
578
+ <tr>
579
+ <td><a href="$.Session.html">Session</a></td>
580
+ <td class="oblique">$</td>
581
+ </tr>
582
+ <tr>
583
+ <td><a href="$.text.analysis.Session.html">Session</a></td>
584
+ <td class="oblique">$.text.analysis</td>
585
+ </tr>
586
+ <tr>
587
+ <td><a href="$.text.mining.Session.html">Session</a></td>
588
+ <td class="oblique">$.text.mining</td>
589
+ </tr>
590
+ <tr>
591
+ <td><a href="$.net.SMTPConnection.html">SMTPConnection</a></td>
592
+ <td class="oblique">$.net</td>
593
+ </tr>
594
+ <tr>
595
+ <td><a href="$.db.SQLException.html">SQLException</a></td>
596
+ <td class="oblique">$.db</td>
597
+ </tr>
598
+ <tr>
599
+ <td><a href="$.hdb.SQLException.html">SQLException</a></td>
600
+ <td class="oblique">$.hdb</td>
601
+ </tr>
602
+ <tr>
603
+ <td><a href="$.security.Store.html">Store</a></td>
604
+ <td class="oblique">$.security</td>
605
+ </tr>
606
+ <tr>
607
+ <td><a href="$.web.TupelList.html">TupelList</a></td>
608
+ <td class="oblique">$.web</td>
609
+ </tr>
610
+ <tr>
611
+ <td><a href="$.web.WebEntityRequest.html">WebEntityRequest</a></td>
612
+ <td class="oblique">$.web</td>
613
+ </tr>
614
+ <tr>
615
+ <td><a href="$.web.WebEntityResponse.html">WebEntityResponse</a></td>
616
+ <td class="oblique">$.web</td>
617
+ </tr>
618
+ <tr>
619
+ <td><a href="$.web.WebRequest.html">WebRequest</a></td>
620
+ <td class="oblique">$.web</td>
621
+ </tr>
622
+ <tr>
623
+ <td><a href="$.web.WebResponse.html">WebResponse</a></td>
624
+ <td class="oblique">$.web</td>
625
+ </tr>
626
+ <tr>
627
+ <td><a href="$.util.Zip.html">Zip</a></td>
628
+ <td class="oblique">$.util</td>
629
+ </tr>
630
+ </table>
631
+ <h3>Namespaces</h3>
632
+ <ul>
633
+ <li><a href="$.html"><span class="oblique"></span>$</a></li>
634
+ <li><a href="$.db.html"><span class="oblique">$.</span>db</a></li>
635
+ <li><a href="$.hdb.html"><span class="oblique">$.</span>hdb</a></li>
636
+ <li><a href="$.jobs.html"><span class="oblique">$.</span>jobs</a></li>
637
+ <li><a href="$.net.html"><span class="oblique">$.</span>net</a></li>
638
+ <li><a href="$.net.http.html"><span class="oblique">$.net.</span>http</a></li>
639
+ <li><a href="$.security.html"><span class="oblique">$.</span>security</a></li>
640
+ <li><a href="$.security.crypto.html"><span class="oblique">$.security.</span>crypto</a></li>
641
+ <li><a href="$.security.x509.html"><span class="oblique">$.security.</span>x509</a></li>
642
+ <li><a href="$.text.html"><span class="oblique">$.</span>text</a></li>
643
+ <li><a href="$.text.analysis.html"><span class="oblique">$.text.</span>analysis</a></li>
644
+ <li><a href="$.text.mining.html"><span class="oblique">$.text.</span>mining</a></li>
645
+ <li><a href="$.trace.html"><span class="oblique">$.</span>trace</a></li>
646
+ <li><a href="$.util.html"><span class="oblique">$.</span>util</a></li>
647
+ <li><a href="$.util.codec.html"><span class="oblique">$.util.</span>codec</a></li>
648
+ <li><a href="$.util.compression.html"><span class="oblique">$.util.</span>compression</a></li>
649
+ <li><a href="$.util.sql.html"><span class="oblique">$.util.</span>sql</a></li>
650
+ <li><a href="$.web.html"><span class="oblique">$.</span>web</a></li>
651
+ </ul>
652
+ </nav>
653
+ <br clear="both">
654
+ <footer>
655
+ <a href="Copyright-SAP.html">Copyright</a>
656
+ &
657
+ <a href="Disclaimer-SAP.html">Disclaimer</a>
658
+ </footer>
659
+ <script>prettyPrint();</script>
660
+ <script src="scripts/linenumber.js"></script>
661
+ </body>
662
+
663
+ </html>