How to Add actions:
- Open the actions pane
- Use the inline Menu
If we open toggle function pallet, by default we would not see the XSL constructors, we have to click the XSLT button to enable to see it.
Note:
Why we need to implement error handling / designing beyond the happy path:
Instead of allowing the error hospital to catch every fault, we can intentionally catch all fault using the global and scope fault handlers.
Best practice Examples of error handling:
Implementing Global Fault handler:
Global fault handlers End actions;
For each invoke , try to create a scope and define scope fault handler.
Note:
For my project, I have followed as below:
Case study:
I want to create a dynamic file name to be written to FTP folder but the dynamic file name provided in the mapper is not used by OIC.
The file name has been mapped in the ftp mapper but the file that is written to FTP uses the file name pattern specified in FTP adapter write file action.
Example:
file name pattern under write file.action: demo.txt
File nane in the mapper under properies : newfilename
during run output filename came: demo.txt
But expected is : newfilename
Screenshots what we did:
FTP write adpater configure page:
Usecase: Here , we will see how to schedule and download HCM Extract and send to downstream applications using Oracle HCM cloud adpater.
High level:
We will create 3 integrations and achieve our goal as follow:
How to use Dates, Timestamps and intervals in Oracle databases.
Data types available:
Date:
The DATE datatype is used by Oracle to store all datetime information where a precision greater than 1 second is not needed. Oracle uses a 7 byte binary date format which allows Julian dates to be stored within the range of 01-Jan-4712 BC to 31-Dec-9999 AD.
Example (10-JUL-2004 17:21:30)
Date functions:
SYSDATE:
Returns the current date-time from the operating system of the database server.
SELECT SYSDATE FROM dual; SYSDATE ------------------- 10/07/2004 18:34:12 1 row selected.
CURRENT_DATE
ADD_MONTHS(date, months)
LAST_DAY(date)
MONTHS_BETWEEN(date, date)
NEXT_DAY(date, day)
NEW_TIME(date, timezone1, timezone2)
TO_CHAR(date, format):
Converts a specified date to a string using the specified format mask. If the format mask is omitted the NLS_DATE_FORMAT
value is used.
SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI') FROM dual; TO_CHAR(SYSDAT -------------- 10/07/04 18:48 1 row selected.
For different parameters or format mask:
https://www.techonthenet.com/oracle/functions/to_char.php
TO_DATE(date_string, format):
Converts a specified string to a date using the specified format mask. If the format mask is omitted the NLS_DATE_FORMAT
value is used.
SELECT TO_DATE('10/07/2004 13:31:45', 'DD/MM/YYYY HH24:MI:SS') FROM dual; TO_DATE('10/07/2004 ------------------- 10/07/2004 13:31:45 1 row selected.
ROUND(date, format):
Returns a date rounded to the level specified by the format. The default value for the format is DD, returning the date without the fractional (time) component, making it represent midnight on the specified date, or the following date depending on the rounding.
SELECT SYSDATE, ROUND(SYSDATE, 'HH24') FROM dual; SYSDATE ROUND(SYSDATE,'HH24 ------------------- ------------------- 10/07/2004 18:54:24 10/07/2004 19:00:00 1 row selected.
TRUNC(date, format):
Returns a date truncated to the level specified by the format. The default value for the format is DD, truncating the fractional (time) component, making it represent midnight on the specified date. Using the TRUNC
function allows comparison of dates without the time components distracting from the true meaning of the comparison. It is similar to the round function, except that it always rounds down.
SELECT SYSDATE, TRUNC(SYSDATE, 'HH24') FROM dual; SYSDATE TRUNC(SYSDATE,'HH24 ------------------- ------------------- 10/07/2004 18:55:44 10/07/2004 18:00:00 1 row selected.
The TIMESTAMP
datatype is an extension on the DATE
datatype. In addition to the datetime elements of the DATE
datatype, the TIMESTAMP
datatype holds fractions of a second to a precision between 0 and 9 decimal places, the default being 6. There are also two variants called TIMESTAMP WITH TIME ZONE
and TIMESTAMP WITH LOCAL TIME ZONE
. As their names imply, these timestamps also store time zone offset information.
Example (10-JUL-2004 17:21:30.662509 +01:00)
Select ...
From ...
Where datetime_col > to_date('16-Feb-2023', 'DD-Mon-YYYY')
Reference:
https://oracle-base.com/articles/misc/oracle-dates-timestamps-and-intervals
A wildcard character is used to substitute one or more characters in a string. Wildcard characters are used with the LIKE operator with WHERE
clause to search for a specified pattern in a column.
Example:
SELECT * FROM Customers
WHERE CustomerName LIKE 'a%';
The above example shows - get all the customers whose name starts with 'a'
Wildcard characters:Symbol | Description |
---|---|
% | Represents zero or more characters |
_ | Represents a single character |
[] | Represents any single character within the brackets * |
^ | Represents any character not in the brackets * |
- | Represents any single character within the specified range * |
{} | Represents any escaped character ** |
The %
wildcard represents any number of characters, even zero characters.
Return all customers that ends with the pattern 'es':
SELECT * FROM Customers
WHERE CustomerName LIKE '%es';
The _
wildcard represents a single character.
It can be any character or number, but each _
represents one, and only one, character.
City
starting with any character, followed by "ondon":The []
wildcard returns a result if any of the characters inside gets a match.
Return all customers starting with either "b", "s", or "p":
SELECT * FROM Customers
WHERE CustomerName LIKE '[bsp]%';
The -
wildcard allows you to specify a range of characters inside the []
wildcard.
Return all customers starting with "a", "b", "c", "d", "e" or "f":
SELECT * FROM Customers
WHERE CustomerName LIKE '[a-f]%';
NVL() function
NVL() function is used to provide a default value when the specified field is null. we can also use the COALESCE()
function as alternative.
Syntax:
NVL(column_name, default_value)
For example
In the below table, unitOnOrder is optional and can be null.
P_Id | ProductName | UnitPrice | UnitsInStock | UnitsOnOrder |
---|---|---|---|---|
1 | Jarlsberg | 10.45 | 16 | 15 |
2 | Mascarpone | 32.56 | 23 | |
3 | Gorgonzola | 15.67 | 9 | 20 |
SELECT ProductName, UnitPrice * (UnitsInStock + UnitsOnOrder)
FROM Products;
In the example above, if any of the "UnitsOnOrder" values are NULL, the result will be NULL. To avoide such nullibility issue, we use NVL() as below:
SELECT ProductName, UnitPrice * (UnitsInStock + NVL(UnitsOnOrder, 0))
FROM Products;
CASE
expression goes through conditions and returns a value when the first condition is met (like an if-then-else statement). So, once a condition is true, it will stop reading and return the result. If no conditions are true, it returns the value in the ELSE
clause.ELSE
part and no conditions are true, it returns NULL.CREATE SEQUENCE
syntax:Using operators
1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper: File⇾Import⇾Service Bus Resources⇾ Se...