Posts

Showing posts with the label oracle

How to convert rows into comma separated values in SQL Oracle (4 ways to convert)

Image
I have this requirement many times while coding interfaces in oracle apps. Every time, I use different options.    Here, I tried to list out the four different ways of achieving the same. Let’s take the well-known SCOTT schema for our example. The requirement is to show the manager name along with sub-ordinate names in a comma separated list. So first, let us simply join the tables to see the records, OPTION 1: LISTAGG function ( Tested in Oracle 11g) SELECT     manager . ename manager ,           LISTAGG ( suboridinates . ename , ',' )   WITHIN   GROUP   (order   by suboridinates . ename )  suboridinates_list      FROM  emp suboridinates ,  emp manager     WHERE  manager . empno  =  suboridinates . mgr     GROUP   BY    manager . ename ORDER   BY  manager . ename ; ...

Larry Ellison Demos Cloud Migration

It's easy to migrate your on premise database and application to cloud. Let's watch !

Useful WF Query for Oracle E-Business Suite

Image
Here is a WF query for EBS. If you want to see all process and activities on DB instead of status monitor for a completed workflow, it can be useful for you. Just give ITEM_KEY and  ITEM_TYPE parameter and wait for the response. It can takes 3-5 minutes if you are not purging old workflows. SELECT sta.item_type item_type,          sta.activity_result_code result,          pra.process_name || ' : ' || pra.instance_label process_activity_label,          sta.process_activity instance_id,          sta.item_key item_key, sta.begin_date     FROM wf_item_activity_statuses sta, wf_process_activities pra    WHERE     sta.item_key = p_item_key          AND sta.item_type = p_item_type      ...

Converting Number to Word

Image
Problem: How to convert number to word? Example: You need to write po amount in a word format for a report.  98  >>> Ninety-eight Solution: You can use following package for this operation. SELECT ap_amount_utilities_pkg.ap_convert_number( 9815 )  AMOUNT  FROM dual; Probably, you want to take this query in your local language. If so, you must change your NLS_LANGUAGE first. ALTER   SESSION   SET   NLS_LANGUAGE   =   'TURKISH' ; Then, SELECT ap_amount_utilities_pkg.ap_convert_number( 9815 )  AMOUNT  FROM dual; Note: This package supports 12 digit  most  .

Automatic Generation of Charge Account in Requisition Import

Requisition Import process is used to import requisitions from other Oracle or third-party non-Oracle systems. Before R12.2.2,  while importing requisitions from Oracle or third-party non-Oracle systems, if users do not provide charge account segment or CCID for other accounts in the Requisitions Interface table (PO_REQUISITIONS_INTERFACE), then these requisitions are not imported. The interface expects the accounts (charge, budget, variance, and accrual) as mandatory fields and does not process requisitions unless the charge account is populated. With this new feature, when requisitions are imported using the Requisition Import Process, the Charge, Budget, Variance and Accrual accounts for the requisitions are generated automatically by calling the Requisition Account Generator Workflow. Automatic generation of the charge account CCID happens only if the charge account and corresponding segments are empty. You can check following document to get more information. ...

R12 Table Naming Convention

Here is a good explanation for table name conversiton in Oracle R12.   _ALL Table holds all the information about different operating units. Multi-Org environment. You can also set the client_info to specific operating unit to see the data specific to that operating unit only.   _TL Tables corresponding to another table with the same name minus the _TL. These tables provide multiple language support. For each item in the table without _TL there can be many rows in the _TL table, but all with different values in the LANGUAGE column.   _B These are the CORE BASE tables. They are very important and the data is stored in the table with all validations. It is supposed that these table will always contain the perfect format data. If anything happens to the BASE table data, then it is a data corruption issue.   _F These are date tracked tables, which occur in HR and Payroll. For these there are two date columns EFFECTIVE_START_DATE and EFFECTIVE_END_DATE whic...