Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > CREATE EXTERNAL TABLE (XPS) >

Using the CHECK Constraint

Check constraints allow you to designate conditions that must be met before data can be assigned to a column during an INSERT or UPDATE statement. When a reject file does not exist and a row evaluates to false for any check constraint defined on a table during an insert or update, the database server returns an error. When there is a reject file and a row evaluates to false for a check constraint defined on the table, the error is reported in the reject file and the statement continues to execute.

Check constraints are defined with search conditions. The search condition cannot contain subqueries, aggregates, host variables, or SPL routines. In addition, it cannot include the built-in functions CURRENT, USER, SITENAME, DBSERVERNAME, or TODAY. When you define a check constraint at the column level, the only column that the check constraint can check against is the column itself. In other words, the check constraint cannot depend upon values in other columns of the table.

DATAFILES Clause

The DATAFILES clause specifies external files that are opened when you use external tables.

Read syntax diagramSkip visual syntax diagramDATAFILES Clause:
 
|--DATAFILES---------------------------------------------------->
 
      .-,------------------------------------------------------------.
      V                                                              |
>--(----'--+-DISK-+--:--+-coserver_num---+--:--+-fixed_path-----+--'-+--)--|
           '-PIPE-'     '-coserver_group-'     '-formatted_path-'
 

Element Description Restrictions Syntax
coserver_group Coserver group that contains the external data Must exist Identifier
coserver_num Numeric ID of coserver containing the external data Must exist Literal Number
fixed_path Pathname for input or output files in the definition of the external table Must exist Must conform to operating-system rules.
formatted_path Formatted pathname that uses pattern-matching characters Must exist Must conform to operating-system rules.

You can use cogroup names and coserver numbers when you describe the input or output files for the external table definition. You can identify the DATAFILES either by coserver number or by cogroup name. A coserver number contains only digits. A cogroup name is a valid identifier that begins with a letter but otherwise contains any combination of letters, digits, and underscore symbols.

If you use only some of the available coservers for reading or writing files, you can designate these coservers as a cogroup using onutil and then use the cogroup name, rather than explicitly specifying each coserver and file separately. Whenever you use all coservers to manage external files, you can use the predefined coserver_group.

For examples of the DATAFILES clause, see Examples.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]