OD Clone 4D Table

4D - Documentation   Français   English   German   English   4D for Oracle, Command Theme List   4D for Oracle, Command Alphabetical List   Back   Previous   Next

version 6.0 (Modified)


OD Clone 4D Table (login_ID{; 4DTableNumber{; options}}) Integer

ParameterTypeDescription
login_IDLongintConnection Identifier
4DTableNumberInteger4D Table Number
optionsLongintOptions
Function resultIntegerError code (1 = the operation is successful,
0 = the user clicks Cancel, -1 = an error occurs)

Description

The OD Clone 4D Table function creates an Oracle table with column definitions equivalent to a 4th Dimension table.

login_ID must be a valid connection identifier.

4DTableNumber is the number of the 4th Dimension table, the structure of which is duplicated.

options is a combination of options. Several options can be chosen by adding their values. The options are the following:

OptionDescription
kReplace=1OD Clone 4D Table generates a DROP TABLE statement before creating
the new table.
kWithoutSubtable=2OD Clone 4D Table ignores subtables. The cloning of subtables is not
currently supported. This option must be requested for any table
containing a subtable.
kWithoutText=4OD Clone 4D Table ignores fields of type Text.
kWithoutPicture=8OD Clone 4D Table ignores fields of type Picture.
kWithout=16OD Clone 4D Table ignores fields of type Blob.

If 4DTableNumber is not specified, OD Clone 4D Table displays the Clone a Table dialog box.

The pop-up menu allows you to choose the 4th Dimension table to be cloned and the check boxes list the available options.

The new table has the name of the 4th Dimension table and its columns have the names of the fields in the 4th Dimension table. If a field name contains spaces, the spaces are replaced by underscores.

Types are converted according to the following rules:

4th DimensionOracle
Alpha (length)CHAR(long)
TextLONG
RealFLOAT
IntegerINTEGER
LongintINTEGER
DateDATE
HourDATE
BooleanNUMBER(1)
PictureLONG RAW

If a 4th Dimension field has the Mandatory attribute, the corresponding column is created with the NOT NULL option.

An index is created for each indexed field. Its name is a concatenation of the 4th Dimension table name, the "$" sign, and the field name, prefixed by "I_" suffix. For example, an index for the Sal field of the EMP table would be named "I_EMP$SAL".

If a 4th Dimension field has the Unique attribute, the index is created with the UNIQUE option.

Note: In Oracle Version 6, certain restrictions exist for typing columns. For example, there cannot be more than one column of LONG RAW type per table, and the maximum size of a column is 64K. Refer to your Oracle Reference manual for more information.

OD Clone 4D Table returns 1 if the operation is successful, -1 if an error occurs, or 0 if the user clicks Cancel.

Example

The following method copies the tables in the 4th Dimension database to the Oracle server. If a table already exists on the server, it is automatically replaced.

   Login_ID:=OD Login dialog
   If (Login_ID>0)
      For($i;1;Count tables)
         rc:=OD Clone 4D Table (Login_ID;$i;1)
      End for
   End if

See Also

OD Login.

System Variables and Sets

If the user clicks OK, the OK system variable is set to 1. If the user clicks Cancel, the OK system variable is set to 0.


4D - Documentation   Français   English   German   English   4D for Oracle, Command Theme List   4D for Oracle, Command Alphabetical List   Back   Previous   Next