|
| Home | Getting Started | Documentation | Demo | Download | Support |
2.4 Bulk LoadTo do bulk load use the following statements:
LOAD "path_to_file" "document_name"
The first parameter is a path to the file which contains a document to be loaded. The second parameter is the name for this document in the database.
LOAD "path_to_file" "document_name" "collection_name"
The first parameter is a path to the file which contains a document to be loaded. The second parameter is the name for this document in the database. The third parameter is the collection name to load the document into. For performing bulk load not from the source file but from an input stream, use the following statements:
LOAD STDIN "document_name"
LOAD STDIN "document_name" "collection_name"
Compared to the above bulk load statements, here the "file_name" is replaced by the keyword STDIN to denote that the file to be loaded is taken from the input stream. Characters in the input stream must form a well-formed XML document, which is loaded into the database and named as specified by "document_name". If collection_name is set, the document is loaded into the specified collection of the database. By default, the standard input stream is used. You can redirect a different input stream to be used as an input for bulk load. For example, an XML document produced by some program as its output can be loaded to a Sedna database in a stream-wise fashion. To redirect the input when working from a command line, you can use the functionality provided by your operation system. Java and Scheme APIs provide additional wrappers for bulk load from stream, such that the input stream can be specified by an additional argument of a function call. By default, Sedna removes boundary whitespaces according to the boundary-space policy defined in [3]. To control boundary whitespaces processing, use boundary-space declaration [3] in the prolog of the LOAD statement. The following example illustrates a boundary-space declaration that instructs Sedna to preserve whitespaces:
declare boundary-space preserve;
|