4.1 Create New Data Source
This topic provides the systematic instructions to create a new Data Source.
- On the Function Generation screen, right-click on the DataSource node and select the Add option to create a new DataSource.
- Or Left click on the DataSource node.The Data Source Summary screen displays.
Figure 4-1 Adding a New Data Source
- Click Add DataSource (+) icon on the top right of the screen to create a new Data Source.
- In the Data Source Summary screen, select the
Data Source Name from the list of values
provided.A list of values will fetch all objects from the business schema.
Figure 4-2 Add Table window
Table 4-1 AddTable- Field Description
Field Description Alias Name If the same table is used more than once in the design, the developer can differentiate the same using different alias names. Data source name will have table name appended with the alias name separated by __. For Example: If the table name is CSTB_UI_COLUMNS and alias name is A. The data source name will be CSTB_UI_COLUMNS__A
.Figure 4-3 Data Source Details
- Specify properties of the created data source.
Table 4-2 Data Source Properties
Field Description Data Source This is a read-only field. Data source name will have defaulted to this field. Master This file identifies whether this data source is the master data source for the screen. Every screen should have one (and only one) master data source. Relation Type Relation type can be selected for the selected data source with the parent, One To One or One To Many. The relation should be One To Many if the parent data source is a Single Record entry and the child data source is Multi Record. Multi Record This field tells about the type of data source in the screen, whether it is a multiple Entry record or the single Entry Record data source, Select the field value Yes or No accordingly. Master Data source cannot be of multi-record type. Pk Cols & Pk Type Pk Cols & Pk Type fields are mandatory.
Provide the Primary key columns of the data source separated by tilde (~) in the PK Col field and its corresponding data types in the PK Type field(also separated by tilde).
For Example: If Pk Cols are CONTRACT_REF_NO (VARCHAR2) and VERSION_NO(NUMBER), Pk Col can be provided as CONTRACT_REF_NO~VERSION_NO and Pk Type can be provided as VARCHAR2~NUMBER
Parent The parent data source has to be mentioned for all data sources except the master data source. Select List provides all the data sources created till that point. The developer can choose the data source from the list. For master data source, the parent should not be provided. Relation Relation with a parent has to be specified for all data sources except the master data source. Keep the parent data source on the left side of the relation.
For Example: If the parent is STTM_CUSTOMER and the child is STTM_CUST_ACCOUNT, and the relationship is based on CUSTOMER_NO and BRANCH_CODE, it has to be provided as
STTM_CUSTOMER.CUSTOMER_NO= STTM_CUST_ACCOUNT.CUSTOMER_NO
ANDSTTM_CUSTOMER.BRANCH_CODE= STTM_CUST_ACCOUNT.BRANCH_CODE
Note: The relationship can be only with parent maintained and the current data source; a third table cannot be introduced in the relationship. Only simple Relational operators and equal to can be used in the relationship.
Where Clause This is an optional field. If only selected records of a particular data source are required, then where clause can be provided. Keyword WHERE need not be provided.
For Example: Where clause can be given as
BRANCH_CODE=GLOBAL.CURRENT_BRANCH
, The values of Where Clause field will be used in generating the query statements for the current data source. During the query of the record, this clause will be added in fn_sys_query of the generated main package.Default Order By This is an optional field. This can be provided for multi-record data sources. While querying they would be fetched in the order by clause provided. Keyword ORDER BY is not required.
For Example: If the user wants to order by EVNET_SEQ_NO, the default order can be provided as EVENT_SEQ_NO.
Type The data source can be selected depending on the Type requirement of the screen design. The options provided are: - Normal: Data from the screen will be persisted in the table. Code for persistence would be available in the generated package.
- Query: The data source can be used for only querying the data; ODT will generate packages without insert or update statements on this data source.
- InOnly: Tool will generate the packages without insert and update on this data. Request XML will contain the data source while the response won’t contain it.
- Summary: This data source can be used for summary and this data source will not be considered while generating the packages.
Mandatory If at least one record has to be provided for this data source, then the data source can be provided as mandatory. Upload Table If adapter upload is required for the function Id, then the data source should be mapped to its corresponding upload table.
Parent topic: Data Sources