ACCENT R allows you to create a new Oracle table or to attach to an existing Oracle table that was created outside of ACCENT R. ACCENT R also allows you to remove (drop) an Oracle table. To perform these functions, you must first define a corresponding Schema Definition for the table and then use the CREATE command to create the table. See Volume I of the ACCENT R Professional Desk Reference Set for more information about Schema Definitions.
The following restrictions apply to a Schema Definition that is used for an Oracle table:
- The first statement in the Schema Definition must be FORM IS ORACLE
- All field names must follow the Oracle naming convention
- The size of a character data field must not exceed 240 characters
- GROUP, OCCURS, and SECONDARY fields are not allowed
- The USAGE clause is not allowed
- Multiple record types are not allowed
- The NULL or NOT NULL option is not available in ACCENT R
- The time portion of the date time data type is ignored
- Oracle does not support the BIT, MONEY, DECIMAL, and PACKDECIMAL data types
It is important to note that the ACCENT R SD Object is separate and distinct from the Oracle Server. An SD (Schema Definition) Object refers to the columns and attributes which comprise the rows of a table. An Oracle Server refers to the name of an Oracle database file or files which serve as the physical repository of the data and tables.
*USE DBL NISDATA:BOOKS
*DEFINE SD MAILER
(Your favorite editor is invoked here from the system field @EDITOR)
FORM IS ORACLE
NAME, CHAR, 30, TITLE = "PERSON’S NAME:
"COMPANY, CHAR, 40, VALID IF VALUE # ""
ADDRESS1, CHAR, 40
ADDRESS2, CHAR, 40
CITY, CHAR, 20
STATE, CHAR, 2
ZIP, CHAR, 9, OE = "*****-****"
MAILER_DATE, FULLDATE
PRIORITY, INT, 1(Leave your favorite editor here)
--SAVE *NOTES: Whenever DBL objects are defined or modified, the command to invoke the editor which is stored in the system field @EDITOR will be executed. For example, @EDITOR might contain the string 'EDIT/EDT' through the following ICL command:
SET 'EDIT/EDT' to @EDITOR <return>
When leaving the editor, you should enter SAVE at the double hyphen prompt to compile the object and exit to the ACCENT R prompt. Enter HOLD to store the source code in the object without compiling. Enter STOP to exit to the ACCENT R prompt if no action is to be taken.
Any data type that you use in a Schema Definition must be common to the two systems because not all the data types offered in ACCENT R are available in Oracle and vice versa. Figure 12 shows the corresponding data types for ACCENT R and Oracle, while Figure 11 shows the corresponding data types for Oracle and ACCENT R. If you are defining a Schema Definition for an existing table, it is your responsibility to make sure the data types for all fields match. The command OSQL CREATE DS will convert data according to Figure 12.
ACCENT R |
Oracle |
Remarks |
CHAR (N) |
Specifies a fixed length series of ASCII bytes with a maximum length of 240 bytes. |
|
CHAR |
Same as CHAR, but ACCENT R only permits a series of alphabetic letters and spaces. |
|
VARCHAR |
Specifies a varied length series of ASCII bytes with a maximum length of 240 bytes. |
|
NUMBER (N) |
Specifies a signed 32-bit integer. Values between -2**31 to (2**31)-1 can be stored. |
|
NUMBER (N) |
Specifies a 32-bit floating point number with precision to about 7 decimal digits. |
|
NUMBER (N) |
Specifies a 64-bit floating point number with precision to about 15 decimal digits. |
|
NUMBER (6) |
Specifies an ACCENT R date which is stored as an integer in the form YYMMDD. |
|
NUMBER (8) |
Specifies an ACCENT R date which is stored as an integer in the form YYYYMMDD. |
|
DATE |
Specifies a 64-bit Oracle date and time. The time portion is currently ignored. |
|
|
Not supported by Oracle. |
|
|
Not supported by Oracle. |
|
NUMBER (6) |
Specifies a signed 16-bit integer. |
|
|
Not supported by Oracle. |
|
|
Not supported by Oracle. |
Figure 12 ACCENT R Data Types Supported in Oracle
Oracle |
ACCENT R |
Remarks |
CHAR [CHARACTER] |
CHAR, N |
Variable length character data, N characters in length. The maximum size is 240 characters. |
VARCHAR2, N |
CHAR, N |
Variable length character data, N characters in length. The maximum size of 2000. |
VARCHAR |
Same as CHAR. |
|
DATETIME |
Valid dates range from January 1, 4712 BC to December 31, 4712 AD. The time information is currently ignored. |
|
VARCHAR, N |
Character data up to 30,000 characters. |
|
VARCHAR, N |
Character data up to 30,000 characters. |
|
VARCHAR, N |
Character data in hexadecimal notation up to 240 characters. |
|
VARCHAR, N |
Character data in hexadecimal notation up to 30,000 characters. |
|
|
Not supported in ACCENT R. |
|
FLOAT |
Specifies a signed 64-bit integer with an implied decimal point. The scale is ignored in ACCENT R but the column results are rounded as necessary. |
|
FLOAT |
Same as NUMBER. |
|
INTEGER [INT] |
FLOAT |
Specifies a signed 32-bit integer. (The Oracle data type does not have a corresponding ACCENT R data type. Use FLOAT.) |
REAL |
Specifies a signed 16-bit integer. |
|
FLOAT |
Same as NUMBER. |
|
FLOAT |
Same as NUMBER, but with 63 digits of precision. |
Figure 13 Oracle Data Types Supported in ACCENT R