/usr/share/doc/libhsqldb-java-doc/guide/texttables-chapt.html is in libhsqldb-java-doc 2.3.3+dfsg2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 | <html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 5. Text Tables</title>
<link href="../docbook.css" type="text/css" rel="stylesheet">
<meta content="DocBook XSL-NS Stylesheets V1.76.1" name="generator">
<meta name="keywords" content="HyperSQL, HSQLDB, SQL, Text, Tables">
<meta name="keywords" content="Hsqldb, HyperSQL, Database, JDBC, Java">
<link rel="home" href="index.html" title="HyperSQL User Guide">
<link rel="up" href="index.html" title="HyperSQL User Guide">
<link rel="prev" href="databaseobjects-chapt.html" title="Chapter 4. Schemas and Database Objects">
<link rel="next" href="accesscontrol-chapt.html" title="Chapter 6. Access Control">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table summary="Navigation header" width="100%">
<tr>
<td align="left" width="30%"><a accesskey="p" href="databaseobjects-chapt.html"><img src="../images/db/prev.png" alt="Prev"></a> </td><td align="center" width="40%" style="font-weight:bold;">Chapter 5. Text Tables</td><td align="right" width="30%"> <a accesskey="n" href="accesscontrol-chapt.html"><img src="../images/db/next.png" alt="Next"></a></td>
</tr>
<tr>
<td valign="top" align="left" width="30%">Chapter 4. Schemas and Database Objects </td><td align="center" width="40%"><a accesskey="h" href="index.html"><img src="../images/db/home.png" alt="Home"></a></td><td valign="top" align="right" width="30%"> Chapter 6. Access Control</td>
</tr>
</table>
</div>
<HR>
<div class="chapter" title="Chapter 5. Text Tables">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="texttables-chapt"></a>Chapter 5. Text Tables</h2>
</div>
<div>
<h3 class="subtitle">
<i>Text Tables as a Standard Feature of Hsqldb</i>
</h3>
</div>
<div>
<div class="authorgroup">
<div class="author">
<h3 class="author">
<span class="firstname">Bob</span> <span class="surname">Preston</span>
</h3>
<div class="affiliation">
<span class="orgname">The HSQL Development Group<br>
</span>
</div>
</div>
<div class="author">
<h3 class="author">
<span class="firstname">Fred</span> <span class="surname">Toussi</span>
</h3>
<div class="affiliation">
<span class="orgname">The HSQL Development Group<br>
</span>
</div>
</div>
</div>
</div>
<div>
<p class="releaseinfo">$Revision: 5212 $</p>
</div>
<div>
<div class="legalnotice" title="Legal Notice">
<a name="N11B05"></a>
<p>Copyright 2002-2012 Bob Preston and Fred Toussi. Permission is
granted to distribute this document without any alteration under the
terms of the HSQLDB license. Additional permission is granted to the
HSQL Development Group to distribute this document with or without
alterations under the terms of the HSQLDB license.</p>
</div>
</div>
<div>
<p class="pubdate">2015-06-29 22:26:11-0400</p>
</div>
</div>
</div>
<div class="toc">
<p>
<b>Table of Contents</b>
</p>
<dl>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_overview">Overview</a></span>
</dt>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_implementation">The Implementation</a></span>
</dt>
<dd>
<dl>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_table_definition">Definition of Tables</a></span>
</dt>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_scope">Scope and Reassignment</a></span>
</dt>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_nulls">Null Values in Columns of Text Tables</a></span>
</dt>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_configuration">Configuration</a></span>
</dt>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_disconnect">Disconnecting Text Tables</a></span>
</dt>
</dl>
</dd>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_issues">Text File Usage</a></span>
</dt>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_global_props">Text File Global Properties</a></span>
</dt>
<dt>
<span class="section"><a href="texttables-chapt.html#ttc_transactions">Transactions</a></span>
</dt>
</dl>
</div>
<div class="section" title="Overview">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ttc_overview"></a>Overview</h2>
</div>
</div>
</div>
<p>Text Table support for HSQLDB was originally developed by Bob
Preston independently from the Project. Subsequently Bob joined the
Project and incorporated this feature into version 1.7.0, with a number of
enhancements, especially the use of conventional SQL commands for
specifying the files used for Text Tables.</p>
<p>In a nutshell, Text Tables are CSV or other delimited files treated
as SQL tables. Any ordinary CSV or other delimited file can be used. The
full range of SQL queries can be performed on these files, including
SELECT, INSERT, UPDATE and DELETE. Indexes and unique constraints can be
set up, and foreign key constraints can be used to enforce referential
integrity between Text Tables themselves or with conventional
tables.</p>
<p>The delimited file can be created by the engine, or an existing file
can be used.</p>
<p>HyperSQL with Text Table support is the only comprehensive solution
that employs the power of SQL and the universal reach of JDBC to handle
data stored in text files.</p>
</div>
<div class="section" title="The Implementation">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ttc_implementation"></a>The Implementation</h2>
</div>
</div>
</div>
<div class="section" title="Definition of Tables">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ttc_table_definition"></a>Definition of Tables</h3>
</div>
</div>
</div>
<p>Text Tables are defined similarly to conventional tables with the
added TEXT keyword.</p>
<pre class="programlisting"> CREATE TEXT TABLE <tablename> (<column definition> [<constraint definition>])</pre>
<p>The table is at first empty and cannot be written to. An
additional SET command specifies the file and the separator character
that the Text table uses. It assigns the file to the table.</p>
<pre class="programlisting"> SET TABLE <tablename> SOURCE <quoted_filename_and_options> [DESC]</pre>
</div>
<div class="section" title="Scope and Reassignment">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ttc_scope"></a>Scope and Reassignment</h3>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>A Text table without a file assigned to it is READ ONLY and
EMPTY.</p>
</li>
<li class="listitem">
<p>Reassigning a Text Table definition to a new file has
implications in the following areas:</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>The user is required to be an administrator.</p>
</li>
<li class="listitem">
<p>Existing transactions are committed at this point.</p>
</li>
<li class="listitem">
<p>Constraints, including foreign keys referencing this
table, are kept intact but not checked. It is the responsibility
of the administrator to ensure their integrity.</p>
</li>
</ol>
</div>
<p>The new source file is scanned and indexes are built when it
is assigned to the table. At this point any violation of NOT NULL,
UNIQUE or PRIMARY KEY constraints are caught and the assignment is
aborted. However, foreign key constraints are not checked at the
time of assignment or reassignment of the source file.</p>
</li>
</ul>
</div>
</div>
<div class="section" title="Null Values in Columns of Text Tables">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ttc_nulls"></a>Null Values in Columns of Text Tables</h3>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>Empty fields are treated as NULL. These are fields where there
is nothing or just spaces between the separators.</p>
</li>
<li class="listitem">
<p>Quoted empty strings are treated as empty strings.</p>
</li>
</ul>
</div>
</div>
<div class="section" title="Configuration">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ttc_configuration"></a>Configuration</h3>
</div>
</div>
</div>
<p>The default field separator is a comma (,). A different field
separator can be specified within the SET TABLE SOURCE statement. For
example, to change the field separator for the table mytable to a
vertical bar, place the following in the SET TABLE SOURCE statement, for
example:</p>
<div class="informalexample">
<pre class="programlisting"> SET TABLE mytable SOURCE "myfile;fs=|"</pre>
</div>
<p>Since HSQLDB treats CHAR and VARCHAR strings the same, the ability
to assign a different separator to the latter is provided. When a
different separator is assigned to a VARCHAR, it will terminate any CSV
field of that type. For example, if the first field is CHAR, and the
second field VARCHAR, and the separator fs has been defined as the pipe
(|) and vs as the period (.) then the data in the CSV file for a row
will look like:</p>
<pre class="screen"> First field data|Second field data.Third field data</pre>
<p>This facility in effect offers an extra, special separator which
can be used in addition to the global separator. The following example
shows how to change the default separator to the pipe (|), VARCHAR
separator to the period (.) within a SET TABLE SOURCE statement:</p>
<div class="informalexample">
<pre class="programlisting"> SET TABLE mytable SOURCE "myfile;fs=|;vs=."</pre>
</div>
<p>HSQLDB also recognises the following special indicators for
separators:</p>
<div class="variablelist" title="special indicators for separators">
<p class="title">
<b>special indicators for separators</b>
</p>
<table border="0">
<col valign="top" align="left">
<tbody>
<tr>
<td>
<p>
<span class="term">\semi</span>
</p>
</td><td>
<p>semicolon</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">\quote</span>
</p>
</td><td>
<p>single-quote</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">\space</span>
</p>
</td><td>
<p>space character</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">\apos</span>
</p>
</td><td>
<p>apostrophe</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">\n</span>
</p>
</td><td>
<p>newline - Used as an end anchor (like $ in regular
expressions)</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">\r</span>
</p>
</td><td>
<p>carriage return</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">\t</span>
</p>
</td><td>
<p>tab</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">\\</span>
</p>
</td><td>
<p>backslash</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">\u####</span>
</p>
</td><td>
<p>a Unicode character specified in hexadecimal</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>Furthermore, HSQLDB provides csv file support with three
additional boolean options: <code class="varname">ignore_first</code>,
<code class="varname">quoted</code> and <code class="varname">all_quoted</code>. The
<code class="varname">ignore_first</code> option (default false) tells HSQLDB to
ignore the first line in a file. This option is used when the first line
of the file contains column headings. The <code class="varname">all_quoted</code>
option (default false) tells the program that it should use quotes
around all character fields when writing to the source file. The
<code class="varname">quoted</code> option (default true) uses quotes only when
necessary to distinguish a field that contains the separator character.
It can be set to false to prevent the use of quoting altogether and
treat quote characters as normal characters. These options may be
specified within the <code class="literal">SET TABLE SOURCE</code>
statement:</p>
<pre class="programlisting"> SET TABLE mytable SOURCE "myfile;ignore_first=true;all_quoted=true"</pre>
<p>When the default options <code class="literal">all_quoted=</code>
<code class="literal">false</code> and <code class="literal">quoted=true</code> are in
force, fields that are written to a line of the csv file will be quoted
only if they contain the separator or the quote character. The quote
character is doubled when used inside a string. When
<code class="literal">all_quoted=false</code> and <code class="literal">quoted=false</code>
the quote character is not doubled. With this option, it is not possible
to insert any string containing the separator into the table, as it
would become impossible to distinguish from a separator. While reading
an existing data source file, the program treats each individual field
separately. It determines that a field is quoted only if the first
character is the quote character. It interprets the rest of the field on
this basis.</p>
<p>The character encoding for the source file is<code class="literal"> ASCII
</code>by default. To support UNICODE or source files prepared with
different encodings this can be changed to <code class="literal">UTF-8</code> or
any other encoding. The default is <code class="literal">encoding=ASCII </code>and
the option <code class="literal">encoding=UTF-8</code> or other supported
encodings can be used.</p>
<p>Finally, HSQLDB provides the ability to read a text file as READ
ONLY, by placing the keyword "DESC" at the end of the SET TABLE SOURCE
statement:</p>
<pre class="programlisting"> SET TABLE mytable SOURCE "myfile" DESC</pre>
<p>Text table source files are cached in memory. The maximum number
of rows of data that are in memory at any time is controlled by the
<code class="varname">cache_rows</code> property. The default value for
<code class="varname">cache_rows</code> is 1000 and can be changed by setting the
default database property .The <code class="varname">cache_size</code> property
sets the maximum amount of memory used for each text table. The default
is 100 KB. The properties can be set for individual text tables. These
properties do not control the maximum size of each text table, which can
be much larger. An example is given below:</p>
<pre class="programlisting"> SET TABLE mytable SOURCE "myfile;ignore_first=true;all_quoted=true;cache_rows=10000;cache_size=1000"</pre>
<p>The properties used in earlier versions, namely the
<code class="varname">textdb.cache_scale</code> and the
<code class="varname">textdb.cache_size_scale</code> can still be used for
backward compatibility, but the new properties are preferred.</p>
<div class="variablelist" title="Supported Properties">
<p class="title">
<b>Supported Properties</b>
</p>
<table border="0">
<col valign="top" align="left">
<tbody>
<tr>
<td>
<p>
<span class="term">quoted = { true | false }</span>
</p>
</td><td>
<p>default is true. If false, treats double quotes as normal
characters</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">all_quoted = { true | false }</span>
</p>
</td><td>
<p>default is false. If true, adds double quotes around all
fields.</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">encoding = <encoding name></span>
</p>
</td><td>
<p>character encoding for text and character fields, for
example, encoding=UTF-8. UTF-16 cannot be used.</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">ignore_first = { true | false }</span>
</p>
</td><td>
<p>default is false. If true ignores the first line of the
file</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">cache_rows= <numeric value></span>
</p>
</td><td>
<p>rows of the text file in the cache. Default is 1000
rows</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">cache_size = <numeric value>r</span>
</p>
</td><td>
<p>total size of the rows in the cache. Default is 100
KB.</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">cache_scale= <numeric value> and cache_size_scale =
<numeric value></span>
</p>
</td><td>
<p>deprecated properties, replaced by cached_rows and
cache_size properties above.</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">fs = <unquoted character></span>
</p>
</td><td>
<p>field separator</p>
</td>
</tr>
<tr>
<td>
<p>
<span class="term">vs = <unquoted character></span>
</p>
</td><td>
<p>varchar separator</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" title="Disconnecting Text Tables">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ttc_disconnect"></a>Disconnecting Text Tables</h3>
</div>
</div>
</div>
<p>Text tables may be <em class="glossterm">disconnected</em> from their
underlying data source, i.e. the text file.</p>
<p>You can explicitly disconnect a text table from its file by
issuing the following statement: </p>
<pre class="programlisting"> SET TABLE mytable SOURCE OFF</pre>
<p>Subsequently, <code class="literal">mytable</code> will be empty and
read-only. However, the data source description will be preserved, and
the table can be re-connected to it with </p>
<pre class="programlisting"> SET TABLE mytable SOURCE ON</pre>
<p>When a database is opened, if the source file for an existing text
table is missing, the table remains disconnected from its data source
but the source description is preserved. This allows the missing source
file to be added to the directory and the table re-connected to it with
the above command.</p>
<p>Disconnecting text tables from their source has several uses.
While disconnected, the text source can be edited outside HSQLDB,
provided data integrity is respected. When large text sources are used,
and several constraints or indexes need to be created on the table, it
is possible to disconnect the source during the creation of constraints
and indexes and reduce the time it takes to perform the
operation.</p>
</div>
</div>
<div class="section" title="Text File Usage">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ttc_issues"></a>Text File Usage</h2>
</div>
</div>
</div>
<p>The following information applies to the usage of text
tables.</p>
<div class="itemizedlist" title="Text File Issues">
<p class="title">
<b>Text File Issues</b>
</p>
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>With file databases, text fiile locations are restricted to
below the directory that contains the database, unless the
<code class="varname">textdb.allow_full_path</code> property is set true as a
Java system property. This feature is for security, otherwise an admin
database user may be able to open random files. The specified text
source path is interpreted differently according to this property. By
default, the path is interpreted as a relative path to the directory
path of database files, it therefore cannot contain the double dot
notation for parent directory. This path is then appended by the
engine to the directory path to form a full path.</p>
<p>When the property is true, and the path starts with the forward
slash or back slash, or the path contains a semicolon, the path is not
appended to the directory path and is used as it is to open the file.
In this usage the path is absolute.</p>
</li>
<li class="listitem">
<p>By default, all-in-memory databases cannot use text tables. To
enable this capability the <code class="varname">textdb.allow_full_path</code>
property must be set <code class="literal">true</code> as a Java system
property. The text file path is used as submitted and interpreted as
an absolute path as described above, or a path relative to the Java
process execute path. These text tables are always read-only.</p>
</li>
<li class="listitem">
<p>Databases store in jars or as files on the classpath and opened
with the res: protocol can reference read-only text files. These files
are opened as resources. The file path is an absolute path beginning
with a forward slash.</p>
</li>
<li class="listitem">
<p>Blank lines are allowed anywhere in the text file, and are
ignored.</p>
</li>
<li class="listitem">
<p>It is possible to define a primary key, identity column, unique,
foreign key and check constraints for text tables.</p>
</li>
<li class="listitem">
<p>When a table source file is used with the<code class="literal">
ignore_first=true </code>option, the first, ignored line is
replaced with a blank line after a SHUTDOWN COMPACT, unless the SOURCE
HEADER statement has been used.</p>
</li>
<li class="listitem">
<p>An existing table source file may include CHARACTER fields that
do not begin with the quote character but contain instances of the
quote character. These fields are read as literal strings.
Alternatively, if any field begins with the quote character, then it
is interpreted as a quoted string that should end with the quote
character and any instances of the quote character within the string
is doubled. When any field containing the quote character or the
separator is written out to the source file by the program, the field
is enclosed in quote character and any instance of the quote character
inside the field is doubled.</p>
</li>
<li class="listitem">
<p>Inserts or updates of CHARACTER type field values are allowed
with strings that contains the linefeed or the carriage return
character. This feature is disabled when both quoted and all_quoted
properties are false.</p>
</li>
<li class="listitem">
<p>ALTER TABLE commands that add or drop columns or constraints
(apart from check constraints) are not supported with text tables that
are connected to a source. First use the SET TABLE <name> SOURCE
OFF, make the changes, then turn the source ON.</p>
</li>
<li class="listitem">
<p>Use the default setting (quoted=true) for selective quoting of
fields. Those fields that need quoting are quoted, other not.</p>
</li>
<li class="listitem">
<p>Use the quoted=false setting to avoid quoting of fields
completely. With this setting any quote character is considered part
of the text.</p>
</li>
<li class="listitem">
<p>Use the all_quoted=true setting to force all fields to be
quoted.</p>
</li>
<li class="listitem">
<p>SHUTDOWN COMPACT results in a complete rewrite of text table
sources that are open at the time. The settings for quoted and
all_quoted are applied for the rewrite.</p>
</li>
</ul>
</div>
</div>
<div class="section" title="Text File Global Properties">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ttc_global_props"></a>Text File Global Properties</h2>
</div>
</div>
</div>
<p>The database engine uses a set of defaults for text table
properties. Each table's data source may override these defaults. It is
also possible to override the defaults globally, so they apply to all text
tables. The statement SET DATABASE TEXT TABLE DEFAULTS <properties
string> can be used to override the default global properties. An
example is given below:</p>
<pre class="programlisting"> SET DATABASE TEXT TABLE DEFAULTS 'all_quoted=true;encoding=UTF-8;cache_rows=10000;cache_size=2000'</pre>
<div class="itemizedlist" title="List of supported global properties">
<p class="title">
<b>List of supported global properties</b>
</p>
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<code class="literal">fs=,</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">vs=,</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">quoted=true</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">all_quoted=false</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">ignore_first=false</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">encoding=ASCII</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">cache_rows=1000</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">cache_size=100</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">textdb.allow_full_path=false (a system
property)</code>
</p>
</li>
</ul>
</div>
</div>
<div class="section" title="Transactions">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ttc_transactions"></a>Transactions</h2>
</div>
</div>
</div>
<p>Text tables fully support transactions. New or changed rows that
have not been committed are not updated in the source file. Therefore the
source file always contains committed rows.</p>
<p>However, text tables are not as resilient to machine crashes as
other types of tables. If the crash happens while the text source is being
written to, the text source may contain only some of the changes made
during a committed transaction. With other types of tables, additional
mechanisms ensure the integrity of the data and this situation will not
arise.</p>
</div>
</div>
<HR xmlns:xi="http://www.w3.org/2001/XInclude">
<P xmlns:xi="http://www.w3.org/2001/XInclude" class="svnrev">$Revision: 5477 $</P>
<div class="navfooter">
<hr>
<table summary="Navigation footer" width="100%">
<tr>
<td align="left" width="40%"><a accesskey="p" href="databaseobjects-chapt.html"><img src="../images/db/prev.png" alt="Prev"></a> </td><td align="center" width="20%"> </td><td align="right" width="40%"> <a accesskey="n" href="accesscontrol-chapt.html"><img src="../images/db/next.png" alt="Next"></a></td>
</tr>
<tr>
<td valign="top" align="left" width="40%">Chapter 4. Schemas and Database Objects </td><td align="center" width="20%"><a accesskey="h" href="index.html"><img src="../images/db/home.png" alt="Home"></a></td><td valign="top" align="right" width="40%"> Chapter 6. Access Control</td>
</tr>
</table>
</div>
</body>
</html>
|