Creating an ACCENT R Schema Definition Object

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:

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.

Example

*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.

Data Types

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

CHAR (N)

Specifies a fixed length series of ASCII bytes with a maximum length of 240 bytes.

ALPHABETIC

CHAR

Same as CHAR, but ACCENT R only permits a series of alphabetic letters and spaces.

VARCHAR

VARCHAR

Specifies a varied length series of ASCII bytes with a maximum length of 240 bytes.

INT

NUMBER (N)

Specifies a signed 32-bit integer.  Values between -2**31 to (2**31)-1 can be stored.

REAL

NUMBER (N)

Specifies a 32-bit floating point number with precision to about 7 decimal digits.

FLOAT

NUMBER (N)

Specifies a 64-bit floating point number with precision to about 15 decimal digits.

DATE

NUMBER (6)

Specifies an ACCENT R date which is stored as an integer in the form YYMMDD.

FULLDATE

NUMBER (8)

Specifies an ACCENT R date which is stored as an integer in the form YYYYMMDD.

DATETIME

DATE

Specifies a 64-bit Oracle date and time.  The time portion is currently ignored.

MONEY

Not supported by Oracle.

BIT

Not supported by Oracle.

SIGNEDBIT

NUMBER (6)

Specifies a signed 16-bit integer.

DECIMAL

Not supported by Oracle.

PACKDECIMAL

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

VARCHAR

Same as CHAR.

DATE

DATETIME

Valid dates range from January 1, 4712 BC to December 31, 4712 AD.  The time information is currently ignored.

LONG

VARCHAR, N

Character data up to 30,000 characters.

LONG VARCHAR

VARCHAR, N

Character data up to 30,000 characters.

RAW

VARCHAR, N

Character data in hexadecimal notation up to 240 characters.

LONG RAW

VARCHAR, N

Character data in hexadecimal notation up to 30,000 characters.

ROW ID

Not supported in ACCENT R.

NUMBER

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.

DECIMAL 
[DEC, NUMERIC]

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.)

SMALLINT

REAL

Specifies a signed 16-bit integer.

FLOAT

FLOAT

Same as NUMBER.

REAL

FLOAT

Same as NUMBER, but with 63 digits of precision.

Figure 13 Oracle Data Types Supported in ACCENT R

USE DBL    Creating and Removing an Oracle Table