Oracle8i interMedia Text Reference
Release 2 (8.1.6)

Part Number A77063-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

Executables, 3 of 4


ctxload

You use ctxload to perform the following operations:

Thesaurus Importing and Exporting

Use ctxload to load a thesaurus from an import file into the iMT thesaurus tables.

An import file is an ASCII flat file that contains entries for synonyms, broader terms, narrower terms, or related terms which can be used to expand queries.

ctxload can also be used to export a thesaurus by dumping the contents of the thesaurus into a user-specified operating-system file.

See Also:

For examples of import files for thesaurus importing, see "Structure of ctxload Thesaurus Import File" in Appendix D

Text Loading

You can use ctxload to load text from a load file into a LONG or LONG RAW column in a table.


Suggestion:

If the target table does not contain a LONG or LONG RAW column or you do not want to load text into a LONG or LONG RAW column, you can use SQL*Loader to populate the table with text.

For more information on loading with SQL*Loader, see "SQL*Loader Example" in Appendix D


A load file is an ASCII flat file that contains the plain text, as well as any structured data (title, author, date, etc.), for documents to be stored in a text table; however, in place of the text for each document, the load file can store a pointer to a separate file that holds the actual text (formatted or plain) of the document.


Note:

The ctxload utility does not support load files that contain both embedded text and file pointers. You must use one method or the other when creating a load file. 


The ctxload utility creates one row in the table for each document identified by a header in the load file.

See Also:

For examples of load files for text loading, see "Structure of ctxload Text Load File" in Appendix D

Document Updating/Exporting

The ctxload utility supports updating database columns from operating system files and exporting database columns to files, specifically LONG RAW, LONG, BLOB and CLOB columns.


Note:

The updating/exporting of data is performed in sections to avoid the necessity of a large amount of memory (up to 2 Gigabytes) for the update/fetch buffer.

As a result, a minimum of 16 Kilobytes of memory is required for document update/export. 


ctxload Syntax

ctxload -user username[/password][@sqlnet_address]
        -name object_name
        -file file_name
       [-pk primary_key]  
       [-export]
       [-update]
       [-thes]
       [-thescase y|n]
       [-thesdump]
       [-separate]
       [-longsize n]
       [-date date_mask]
       [-log file_name]
       [-trace]
       [-commitafter n]

Mandatory Arguments

-user

Specify the username and password of the user running ctxload.

The username and password can be followed immediately by @sqlnet_address to permit logon to remote databases. The value for sqlnet_address is a database connect string. If the TWO_TASK environment variable is set to a remote database, you do not have to specify a value for sqlnet_address to connect to the database.

-name object_name

When you use ctxload to export/import a thesaurus, use object_name to specify the name of the thesaurus to be exported/imported.

You use object_name to identify the thesaurus in queries that use thesaurus operators.


Note:

Thesaurus name must be unique. If the name specified for the thesaurus is identical to an existing thesaurus, ctxload returns an error and does not overwrite the existing thesaurus. 


When you use ctxload to update/export a text field, use object_name to specify the index associated with the text column.

-file file_name

When ctxload is used to import a thesaurus, use file_name to specify the name of the import file which contains the thesaurus entries.

When ctxload is used to export a thesaurus, use file_name to specify the name of the export file created by ctxload.


Note:

If the name specified for the thesaurus dump file is identical to an existing file, ctxload overwrites the existing file. 


When ctxload is used to update a single row in a text column, use file_name to specify the file that stores the text to be inserted into the text column. You identify the destination row with -pk.

When ctxload is used to export a single row in a text column, use file_name to specify the file to which the text is exported. You identify the source row with -pk.

See Also:

For more information about the structure of ctxload import files, see Appendix D, "Loading Examples"

Optional Arguments

-pk

Specify the primary key value of the row to be updated or exported.

When the primary key is compound, you must enclose the values within double quotes and separate the keys with a comma.

-export

Exports the contents of a single cell in a database table into the operating system file specified by -file. ctxload exports the LONG, LONG RAW, CLOB or BLOB column in the row specified by -pk.

When you use the -export, you must specify a primary key with -pk.

-update

Updates the contents of a single cell in a database table with the contents of the operating system file specified by -file. ctxload updates the LONG, LONG RAW, CLOB or BLOB column in for the row specified by -pk.

When you use -update, you must specify a primary key with -pk.

-thes

Import a thesaurus. Specify the source file with the -file argument. You specify the name of the thesaurus to be imported with -name.

-thescase y | n

Specify y to create a case-sensitive thesaurus with the name specified by -name and populate the thesaurus with entries from the thesaurus import file specified by -file. If -thescase is y (the thesaurus is case-sensitive), ctxload enters the terms in the thesaurus exactly as they appear in the import file.

The default for -thescase is n (case-insensitive thesaurus)


Note:

-thescase is valid for use with only the -thes argument. 


-thesdump

Export a thesaurus. Specify the name of the thesaurus to be exported with the -name argument. Specify the destination file with the -file argument.

-separate

For text loading, include this parameter to specify that the text of each document in the load file is a pointer to a separate text file. This instructs ctxload to load the contents of each text file in the LONG or LONG RAW column for the specified row.

-longsize n

For text loading, specify the maximum number of kilobytes to load into the LONG or LONG RAW column.

The minimum value is 1 (that is 1 Kb) and the maximum value is machine dependent.


Note:

You must enter the value for longsize as a number only. Do not include a K or k to indicate kilobytes. 


-date

Specify the TO_CHAR date format for any date columns loaded using ctxload.

See Also:

For more information about the available date format models, see Oracle8i SQL Reference

-log

Specify the name of the log file to which ctxload writes any national-language supported (NLS) messages generated during processing. If you do not specify a log file name, the messages appear on the standard output.

-trace

Enables SQL statement tracing using ALTER SESSION SET SQL_TRACE TRUE. This command captures all processed SQL statements in a trace file, which can be used for debugging. The location of the trace file is operating-system dependent and can be modified using the USER_DUMP_DEST initialization parameter.

See Also:

For more information about SQL trace and the USER_DUMP_DEST initialization parameter, see Oracle8 Administrator's Guide. 

-commitafter n

Specify the number of rows (documents) that are inserted into the table before a commit is issued to the database. The default is 1.

Examples

This section provides examples for some of the operations that ctxload can perform.

See Also:

For more document loading examples, see Appendix D, "Loading Examples"

Thesaurus Import Example

The following example imports a thesaurus named tech_doc from an import file named tech_thesaurus.txt:

ctxload -user jsmith/123abc -thes -name tech_doc -file tech_thesaurus.txt 

Thesaurus Export Example

The following example dumps the contents of a thesaurus named tech_doc into a file named tech_thesaurus.out:

ctxload -user jsmith/123abc -thesdump -name tech_doc -file tech_thesaurus.out 

Exporting a Single Text Field

The following example exports a single text field identified by the primary key value of 1 to the file myfile. The index myindex identifies the text column.

ctxload -user scott/tiger -export -name myindex -file myfile -pk 1 

To export a single text field identified by a compound primary key, you must enclose the primary keys with quotes and separate the values with commas as follows:

ctxload -user scott/tiger -export -name myindex -file myfile -pk "Oracle,1" 

Updating a Single Text Field

The following example updates a single text field identified by primary key value of 1 with the contents of myfile. The index myindex identifies the text column.

ctxload -user scott/tiger -update -name myindex -file myfile -pk 1 

To update a single text field identified by a compound primary key, you must enclose the primary key with quotes and separate the values with commas as follows:

ctxload -user scott/tiger -update -name myindex -file myfile -pk "Oracle,1" 

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index