SQL Queries

The SQLAccess Advisor

DBMS_ADVISOR :- 1. Gather a number of SQL statements that will form the tuning workload. 2. Check that the user running DBMS_ADVISOR has the ADVISOR privilege, and has SELECT access…

Read More

Converting rows to columns using Oracle Pivot clause

The Oracle introduced the PIVOT clause from oracle 11g.  This makes converting rows to column easy. The value in the new columns must be the result of an aggregate function…

Read More

Find the Invalid Email Address using Oracle SQL and PL/SQL

Objective: To find the validity of the email address using Oracle Pl/sql and to find the invalid email address from a object like table using Oracle Sql. Using Pl/Sql: DECLARE…

Read More

To Find IP Address of the User who login into Apex Application

This query will help to sql, Plsql and Apex Developer to find the user IP Address. Normally we tracking only page id, username and time of the user for login…

Read More

Query to Check locks on a table

Select object_id, session_id, oracle_username, os_user_name, Process, locked_mode From sys.v_$locked_object; Select a.object_name, b.oracle_username From all_objects a, v$locked_object b Where a.object_id = b.object_id And a.object_name like ‘po%’;

Read More

Oracle R12 Customer TaxPayer ID Update API

/*Upload the customer data that needs to be updated in a temp table*/ CREATE TABLE scratch.RITM0669580 (account_number VARCHAR2(30), tax_payer_id VARCHAR2(20), tax_reg_num VARCHAR2(50), status VARCHAR2(1), message VARCHAR2(1000)); / set serveroutput on;…

Read More

Oracle R12 Customer Remittance Email Update API

DECLARE x_return_status VARCHAR2 (200) := NULL; x_msg_count NUMBER := 0; x_msg_data VARCHAR2 (200) := NULL; t_output VARCHAR2 (200) := NULL; t_msg_dummy VARCHAR2 (200) := NULL; l_payee_upd_status iby_disbursement_setup_pub.ext_payee_update_tab_type; p_external_payee_tab_type iby_disbursement_setup_pub.external_payee_tab_type; p_ext_payee_id_tab_type…

Read More

Oracle R12 Customer Site Remittance Email Update API

DECLARE x_return_status VARCHAR2 (200) := NULL; x_msg_count NUMBER := 0; x_msg_data VARCHAR2 (200) := NULL; t_output VARCHAR2 (200) := NULL; t_msg_dummy VARCHAR2 (200) := NULL; l_payee_upd_status iby_disbursement_setup_pub.ext_payee_update_tab_type; p_external_payee_tab_type iby_disbursement_setup_pub.external_payee_tab_type; p_ext_payee_id_tab_type…

Read More

Oracle R12 AP Invoice Extract With PO And CHECK Details

select aia.INVOICE_NUM ,aia.INVOICE_AMOUNT ,aia.CREATION_DATE,aia.INVOICE_DATE,aia.SOURCE,aia.INVOICE_TYPE_LOOKUP_CODE INVOICE_TYPE, (select aca.STATUS_LOOKUP_CODE from apps.ap_invoice_payments_all aipa, apps.ap_checks_all aca where aipa.check_id = aca.check_id and nvl(aipa.reversal_flag,’N’) <> ‘Y’ and aipa.invoice_id = aia.invoice_id and aipa.org_id = aia.org_id and rownum…

Read More

Oracle R12 Expense Type Master Based On Operating Unit

SELECT ( SELECT hou.name FROM apps.hr_operating_units hou WHERE hou.organization_id = aerpa.org_id ) operating_unit, aerpa.prompt expense_type, aerpa.flex_description gl_description, aerpa.flex_concactenated gl_code, aerpa.category_code, aerpa.end_date FROM apps.ap_expense_report_params_all aerpa WHERE aerpa.org_id IN ( 382, 402,…

Read More