Call the Create Variable API
To create a Variable, call the API CDR_PUB_DF_VARIABLE.CREATEVARIABLE.
Its signature is:
PROCEDURE CREATEVARIABLE( P_API_VERSION IN NUMBER, P_INIT_MSG_LIST IN VARCHAR2 := CDR_PUB_DEF_CONSTANTS.G_FALSE, P_COMMIT IN VARCHAR2 := CDR_PUB_DEF_CONSTANTS.G_FALSE, P_VALIDATION_LEVEL IN NUMBER := CDR_PUB_DEF_CONSTANTS.G_VALID_LEVEL_FULL, X_RETURN_STATUS OUT VARCHAR2, X_MSG_COUNT OUT NUMBER, X_MSG_DATA OUT VARCHAR2, PIO_NAMING IN OUT CDR_NAMING_VERSION_OBJ_TYPE, PIO_VARIABLE IN OUT CDR_VAR_OBJ_TYPE, PI_DEFCLASSIFICATIONCOLL IN CDR_CLASSIFICATIONS_COLL );
Enter Parameter values as follows:
-
PIO_NAMING. Enter CDR_NAMING_VERSION_OBJ_TYPE values as follows:
-
company_id =
Enter_your_company_ID
-
obj_id = null
-
obj_ver = null
-
object_type_rc =
'$OBJTYPES$CDRVAR'
-
name = '
Enter_a_name_for_the_Variable
'Note:
For the Name and Description attributes, enter a meaningful value appropriate for each Variable. This is important because you will probably create many Variables and you will need to reference them from Parameter definitions and, if you define Tables in your adapter, Table Columns. - namespace_obj_id =
Your_Adapter_Area's_obj_id
- namespace_obj_ver = 1
- namespace_start_obj_ver = 1
- namespace_end_obj_ver=
cdr_def_constants.cdr_max_def_object_version
- owning_location_rc = null
- checked_out_flag_rc =
'$YESNO$NO'
- checked_out_id = null
- object_subtype_id = null
- description =
'Enter_a_Description_for_the_Source_Code
' - copied_from_company_id = null
- copied_from_obj_id = null
- copied_from_obj_ver = null
- ref_company_id = null
- ref_obj_ver = null
- object_version_number = 1
- status_rc =
'$NAMING_STATUS$INSTALLABLE'
- validation_status_rc = null
- version_label = null
-
- PIO_VARIABLE. Enter CDR_VAR_OBJ_TYPE values that apply to the Source Code definition, as follows:
- company_id =
Enter_your_company_ID
- obj_id = null
- obj_ver = 1
- oracle_name =
'Enter_an_Oracle_Name'
- oracle_datatype_rc =
'Enter_one_of_the_valid_values'
Note:
The valid Oracle_Datatype_RC values are:$ORADATATYPES$VARCHAR2
$ORADATATYPES$NUMBER
$ORADATATYPES$DATE
- length =
Enter_the_Variable_length
- precision = null (unless the variable is of data type number and requires a value for precision)
- sas_format = If the data type is varchar2, enter
'$Char.length'
If the data type is number, enter'$Num.length'
If you are creating an adapter to a SAS system, use the following default SAS formatting rules:Varchar2(10) becomes $10; Number(10,5) becomes 10.5;Date becomes datetime.
- sas_v6_name = '
Enter_SAS_v6_name
'Note:
The SAS_V6_Name cannot be longer than 8 characters.
- sas_v8_name =
'Enter_SAS_v8_name'
- sas_label =
'Enter_Sas_Label'
- nullable_flag = Enter
'$YESNO$YES'
or'$YESNO$NO'
depending on whether or not you want the variable to be nullable or mandatory. - default_value = null
- company_id =
Parent topic: Creating a Variable