Note:- I have prepared this query since I could not find any inbuilt functions or procedures in Oracle to get this. I had the requirement to treat 2 dates are same if differences is not more then 2 seconds.

For the Seconds:-
——————-

SELECT (‘Your first Date’-‘Your another Date’) * DECODE( UPPER(‘SS’)
, ‘SS’, 24*60*60 
, ‘MI’, 24*60
, ‘HH’, 24, NULL )
FROM DUAL;

Example:-

SELECT (SYSDATE+1-SYSDATE) * DECODE( UPPER(‘SS’)
, ‘SS’, 24*60*60
, ‘MI’, 24*60
, ‘HH’, 24, NULL )
FROM DUAL;

For Minutes:-
—————

SELECT (‘Your first Date’-‘Your another Date’) * DECODE( UPPER(‘MI’)
, ‘SS’, 24*60*60 
, ‘MI’, 24*60
, ‘HH’, 24, NULL )
FROM DUAL;

Example:-

SELECT (SYSDATE+1-SYSDATE) * DECODE( UPPER(‘MI’)
, ‘SS’, 24*60*60
, ‘MI’, 24*60
, ‘HH’, 24, NULL )
FROM DUAL;

For the Hours:-
—————–

SELECT (‘Your first Date’-‘Your another Date’) * DECODE( UPPER(‘HH’)
, ‘SS’, 24*60*60 
, ‘MI’, 24*60
, ‘HH’, 24, NULL )
FROM DUAL;

Example:-

SELECT (SYSDATE+1-SYSDATE) * DECODE( UPPER(‘HH’)
, ‘SS’, 24*60*60
, ‘MI’, 24*60
, ‘HH’, 24, NULL )
FROM DUAL;

This is the simple decode function made for all the above 3 requirements. I hope this will help you.
Lot of time we want to close the Notification which has come to the user.

They are many ways to do it. The following script can be use to Close the Notification.

/*********************************************
— Date ‘Current Date’
— Author JPREDDY
— Purpose : Close Notifications
**********************************************/
BEGIN 
wf_notification.RESPOND( 12504888, — Notification ID.
‘Close requested by on ‘||Sysdate, — Comments
‘IM12345’ ); — Incident Number. 
COMMIT;
END; 
/You can know the status of the Notification from the following Query.

select * from wf_notifications
where NOTIFICATION_ID=12504888

There is some equal-vent API which does this work.

wf_notification.close(12280094 — Notification ID
,’SYSADMIN’);
When we are define Modifier in the OM module. We can define Modifier at the particular Item or all the Items in the Price List/Item Category etc.

The following query will give the Modifier Name and other details of Particular Item of Price List:-
————————————————————————————————-

SELECT DISTINCT qpa.list_header_id “Modifier Header ID”,
qlh.COMMENTS “Modifier Name (Description)”, 
qpa.list_line_id “Modifier Line ID”, 
qll.start_date_active “Modifier start date”,
qll.end_date_active “Modifier end date”,
qq.qualifier_attr_value “Price List ID”,
qllv.product_attr_value “Inventory Item ID”,
msi.segment1 “SKU”,
qll.arithmetic_operator_type “Application Method”,
qll.operand “Value”, 
qll.product_precedence “Precedence”, 
qll.incompatibility_grp “Incompatibility Group”,
qll.pricing_group_sequence “Bucket”
FROM qp_pricing_attributes qpa,
mtl_system_items_b msi,
qp_qualifiers_v qq,
qp_list_headers_b qlh,
qp_list_lines_v qllv,
qp_modifier_summary_v qll
WHERE qpa.product_attribute = ‘PRICING_ATTRIBUTE3’
AND qq.qualifier_attribute = ‘QUALIFIER_ATTRIBUTE4’
AND qllv.product_attribute = ‘PRICING_ATTRIBUTE1’
AND qllv.product_attr_value = msi.inventory_item_id
AND qllv.list_header_id = qq.qualifier_attr_value
AND qlh.list_header_id = qq.list_header_id
AND qpa.list_header_id = qll.list_header_id
AND qpa.list_line_id = qll.list_line_id
AND qll.list_header_id = qlh.list_header_id
AND qlh.active_flag = ‘Y’
AND msi.segment1 = ‘Your Item Name’
AND SYSDATE BETWEEN qll.start_date_active AND qll.end_date_active
AND TRUNC (NVL (qllv.end_date_active, SYSDATE)) <= TRUNC (SYSDATE)
— AND rownum <=10

Following query can be used to get the Credit Card Number (of different format) from specific column.

Column would have credit card Number in the text date. Date is not in any fixed format. And Credit Card Number would also not in any specific Format. In the following query, we have considered few credit card formats. In can include other formats accordingly as your requirement.

SELECT jtf_note_id, creation_date, LANGUAGE, notes,
CASE
WHEN INSTR (TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’),
‘99999999999999999’
) > 0
THEN SUBSTR (notes,
INSTR (TRANSLATE (UPPER (notes),
 ‘0123456789’,
 ‘9999999999’
 ),
 ‘99999999999999999’
 ),
LENGTH (‘99999999999999999’)
)
WHEN INSTR (TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’),
‘999999999999999’
) > 0
THEN SUBSTR (notes,
INSTR (TRANSLATE (UPPER (notes),
 ‘0123456789’,
 ‘9999999999’
 ),
 ‘999999999999999’
 ),
LENGTH (‘999999999999999’)
)
WHEN INSTR (TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’),
‘9999 9999 9999 9999’
) > 0
THEN SUBSTR (notes,
INSTR (TRANSLATE (UPPER (notes),
 ‘0123456789’,
 ‘9999999999’
 ),
 ‘9999 9999 9999 9999’
 ),
LENGTH (‘9999 9999 9999 9999’)
)
WHEN INSTR (TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’),
‘9999 999999 99999’
) > 0
THEN SUBSTR (notes,
INSTR (TRANSLATE (UPPER (notes),
 ‘0123456789’,
 ‘9999999999’
 ),
 ‘9999 999999 99999’
 ),
LENGTH (‘9999 999999 99999’)
)
WHEN INSTR (TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’),
‘9999-9999-9999-9999’
) > 0
THEN SUBSTR (notes,
INSTR (TRANSLATE (UPPER (notes),
 ‘0123456789’,
 ‘9999999999’
 ),
 ‘9999-9999-9999-9999’
 ),
LENGTH (‘9999-9999-9999-9999’)
)
WHEN INSTR (TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’),
‘9999-999999-99999’
) > 0
THEN SUBSTR (notes,
INSTR (TRANSLATE (UPPER (notes),
 ‘0123456789’,
 ‘9999999999’
 ),
 ‘9999-999999-99999’
 ),
LENGTH (‘9999-999999-99999’)
)
ELSE ‘No Credit card Number’
END “Credit card Number”
FROM jtf_notes_tl
WHERE 1 = 1
AND (TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’) LIKE (‘%999999999999999 %’) ) — 15 digit—
OR TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’) LIKE (‘%9999999999999999 %’)
OR TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’) LIKE (‘%9999 9999 9999 9999 %’)
OR TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’) LIKE (‘%9999 999999 99999 %’)
— below are different formats with ‘-‘ instead of ‘ ”
OR TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’) LIKE (‘%9999-9999-9999-9999 %’)
OR TRANSLATE (UPPER (notes), ‘0123456789’, ‘9999999999’) LIKE (‘%9999-999999-99999 %’)


I hope the above information would be helpful to you.
Flexfields stores main Information of the Organizations. We have many flexfields in different modules.

Note:- The following Flexfields are avilable in the 11.5.8 Oracle Application Version.
—–

You may find more flexfield in the new Oracle apps versions.

To check all the Flexfield avilable for your Oracle Apps version, use the Flexfield Query

Application Name
Flex-field Name
Application Description
CRL Financials Assets
Super Group
CRL Financials – Assets
CRL Financials Assets
Group Asset
CRL Financials – Assets
Oracle Advanced Service Online
AHL Route
Oracle Advanced Service Online
Oracle Advanced Service Online
AHL Operation
Oracle Advanced Service Online
Oracle Assets
Location Flexfield
Oracle Assets
Oracle Assets
Category Flexfield
Oracle Assets
Oracle Assets
Asset Key Flexfield
Oracle Assets
Oracle General Ledger
Accounting Flexfield
Oracle General Ledger
Oracle Human Resources
Soft Coded KeyFlexfield
Oracle Human Resources
Oracle Human Resources
Job Flexfield
Oracle Human Resources
Oracle Human Resources
Grade Flexfield
Oracle Human Resources
Oracle Human Resources
CAGR Flexfield
Oracle Human Resources
Oracle Human Resources
Competence Flexfield
Oracle Human Resources
Oracle Human Resources
Item Contexts Keyflex
Oracle Human Resources
Oracle Human Resources
Personal Analysis Flexfield
Oracle Human Resources
Oracle Human Resources
Position Flexfield
Oracle Human Resources
Oracle Inventory
System Items
Oracle Inventory
Oracle Inventory
Sales Orders
Oracle Inventory
Oracle Inventory
Item Categories
Oracle Inventory
Oracle Inventory
Account Aliases
Oracle Inventory
Oracle Inventory
Item Catalogs
Oracle Inventory
Oracle Inventory
ORACLE_SERVICE_ITEM_FLEXFIELD
Oracle Inventory
Oracle Inventory
Stock Locators
Oracle Inventory
Oracle Payroll
People Group Flexfield
Oracle Payroll
Oracle Payroll
Bank Details KeyFlexField
Oracle Payroll
Oracle Payroll
Cost Allocation Flexfield
Oracle Payroll
Oracle Public Sector Budgeting
PSB Position Flexfield
Oracle Public Sector Budgeting
Oracle Receivables
Territory Flexfield
Oracle Receivables
Oracle Receivables
Sales Tax Location Flexfield
Oracle Receivables
Oracle Receivables
ARTA-Receipt Prof Ident
Oracle Receivables
Oracle Training Administration
Training Resources
Oracle Training Administration