Hey Friends, The basic idea for creating this blog is to have a Technical information about Oracle Applications. To have one such place where you will have a TECHNO-FUNCTIONAL knowledge of Oracle Applications.

Friday, January 12, 2007

SQL: Refresh

I will assume that you know the SQL languages.
What we will see is the depth up to which you know it ….. :)
Following are some of the tricky questions about SQL that you may face at the time of interview.


Difference between delete and truncate.
Both these commands are used for the deletion of the rows from table but the basic difference between the two is DELETE is DML command and one can make use of COMMIT/ROLLBACK after this command. The system get it for you from the Rollback segment. Where as TRUNCATE is DDL command and is auto commit. it removes data directly without copying it into the Rollback segment. This is the reason why TRUNCATE is faster.
Another important difference between the two is of water mark index [DBA term].

To explain this here is one example.
Say I have 10 lac rows in one table. I deleted all the records using DELETE command. Now I will try to select * from that table. You will see that it takes some time to give you the result 'No rows Returned'.
Reason being once you issue DELETE it will remove the data in the specified row but the memory allocated by these rows remains as it is. Where as TRUNCATE will remove the memory allocation as well.

To escape special characters when writing SQL
SELECT 'A ''''double quoted'''' word.' AS text FROM DUAL;

Escape wildcard characters while using LIKE
The LIKE keyword allows for string searches. The '_' wild card character is used to match exactly one character, while '%' is used to match zero or more occurrences of any characters. These characters can be escaped in SQL. Examples:


SELECT name FROM emp
WHERE id LIKE '%/_%' ESCAPE '/';

SELECT name FROM emp
WHERE id LIKE '%\%%' ESCAPE '\';

Escape ampersand (&) characters in SQL*Plus
DEFINE setting can be changed to allow &'s (ampersands) to be used in text:

SET DEFINE ~
SELECT 'Anil & Apps' FROM dual;

SET ESCAPE '\'
SELECT '\&anil' FROM dual;

SET SCAN OFF
SELECT '&anil' x FROM dual;


To eliminate duplicate records

Option 1.
SQL> DELETE FROM table_name A WHERE ROWID > (SELECT min(rowid) FROM table_name B
WHERE A.key_values = B.key_values);

Option 2.
SQL> create table table_name2 as select distinct * from table_name1;SQL> drop table table_name1;
SQL> rename table_name2 to table_name1;

Option 3.
delete from
where rowid not in ( select min(rowid)
from exp group by column1..,column2,...column3..);


To add one day/min/sec to date
select sysdate, (sysdate+1) one_day , (sysdate + 1/24/60)one_min, sysdate + 1/24/(60*60) one_second
from dual;

To get diffrence between two date columns

NUMTODSINTERVAL: This function is new to Oracle 9i. It takes two arguments numtodsinterval(x,c) where x is a number and c is a character string denoting the units of x. Valid units are 'DAY', 'HOUR', 'MINUTE' and 'SECOND'.

select numtodsinterval(date_col_1 – date_col_2 ,'day') time_diff from table_name ;



Matrix report in SQL
SELECT *
FROM (SELECT job,
sum(decode(deptno,10,sal)) DEPT_10,
sum(decode(deptno,20,sal)) DEPT_20,
sum(decode(deptno,30,sal)) DEPT_30,
sum(decode(deptno,40,sal)) DEPT_40,
sum(sal) TOTAL_BY_JOB
FROM emp
GROUP BY job)
ORDER BY 1;


To get n1 to n2 rows from table

select * from emp where rownum <=9
minus
select * from emp where rownum <=7

To add column in the middle of the table

SQL> create table test (ename varchar2(20),salary number);

SQL> rename test to test2;

SQL> create table test3 (id varchar2(20));

SQL> create table test as(select test2.ename,test3.id,test2.salary from test2,test3);


To show Hierarchy structure in SQL
select lpad('-',level*5)'> 'ename hierarchy
from emp
connect by prior empno = mgr
start with mgr is null;


Nth row from table
select * from emp
where (rowid, 0) in (select rowid, mod(rownum, 4) from emp)

Labels:

SQL: Basics

SQL :
Structured Query Language (SQL) is a language that provides an interface to relational database systems. SQL was developed by IBM in the 1970s for use in System R, and is a de facto standard, as well as an ISO and ANSI standard.

Difference between DDL, DML, DCL and TCL commands:
DDL:

Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
CREATE - to create objects in the database
ALTER - alters the structure of the database
DROP - delete objects from the database
TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
COMMENT - add comments to the data dictionary
RENAME - rename an object

DML:
Data Manipulation Language
(DML) statements are used for managing data within schema objects. Some examples:
SELECT - retrieve data from the a database
INSERT - insert data into a table
UPDATE - updates existing data within a table
DELETE - deletes all records from a table, the space for the records remain
MERGE - UPSERT operation (insert or update)
CALL - call a PL/SQL or Java subprogram
EXPLAIN PLAN - explain access path to data
LOCK TABLE - control concurrency

DCL:
Data Control Language (DCL) statements. Some examples:
GRANT - gives user's access privileges to database
REVOKE - withdraw access privileges given with the GRANT command

TCL:
Transaction Control
(TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
COMMIT - save work done
SAVEPOINT - identify a point in a transaction to which you can later roll back
ROLLBACK - restore database to original since the last COMMIT
SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use

Labels:

Wednesday, January 10, 2007

Apps Professionals:



Now there is a basic classification for the Oracle Application professionals.
1. Functional.
2. Techno-Functional.

# Functional:
As mentioned earlier Oracle Application is nothing but a set of Application, a software called as E-Business Suite. So the Functional person is responsible for the front end utilization of the Oracle Application.
Say one of the company wanted to use Oracle Application as an ERP. The role of the functional person starts here. He will take care of the entire information gathering, all the requirements of the customer, its organization. Then he will be doing all installation and setups of Oracle Application to tailor Oracle Application for the customer’s requirement.

# Techno-Functional:
Oracle Application provides a collection of default standard forms and Reports through which user interacts with the Oracle Application. But it may happen and most of the times happen that the client who wants to implement the Oracle Application for his organization needs many modifications in these forms and Reports. Here comes the role of the Techno-Functional person.
He is the one who will be provided with the requirement of the customer/client by Functional person in the Team. And then he will actually do these changes as per the requirements. The reason he is called Techno-Functional is because he has to have a basic knowledge of the business process(a functional side) in order to understand the requirement from the client. As well as he has to have deep knowledge of SQL/PLSQL language, RDBMS concepts, Reports, Forms and the technical information about the module he is dealing with to make these changes. The technical knowledge about the module includes:
1. Database, schemas being used.
2. Important Tables for that module.
3. Relationship between the table structure. ie Links (join conditions) between these tables.
4. Directory structure of the server.


Because I am a techno-functional I will be targetting the Technical side ...... What do you want to be ?

Labels:

Bird’s eye view:

Oracle Applications is a collection of business Enterprise Resource Planning applications developed by Oracle Corporation, which use their core RDBM database technology, mainly referred to as Oracles "E-Business Suite".
As said above APPS is a collection of different APPLICATIONS.
The first question comes what are the different applications that come under the roof of Oracle Applications.
Let me ask you one question before we start which I am sure you will be able to answer it and which in turn is the answer for above question.
Forget about Oracle Application at all and let’s imagine you are running a shop of mobile phones. You predicted that you will require at least 1000 different phones for the month ahead.
What do you do?
Yes!! you buy it from your supplier.

Think of a supplier, like you there will be 100 more shop owners who need mobile phones.
Here come the basic cycle of any business.

1. Demand is placed from customer like you.
2. This is nothing but a sale for the supplier.
3. Supplier will plan for the production of the product for the quantity required.
4. Here comes the material management in picture.
5. Once the production is complete these products are to be packed and dispatched to the customers like you who ordered for the bulk quantity.
6. Once you get the required quantity of phone, you will pay the supplier.

Now each of these phases is nothing but an individual application which all together forms Oracle Applications "E-Business Suite".

Like for demand and supply you have ORACLE ORDER MANAGEMENT (OM).
For PRODUCTION of GOODS you have ORACLE WORK IN PROGRESS
(WIP).
For MATERIAL MANAGEMENT you have ORACLE BILL OF MATERIAL (BOM) and ORACLE INVENTORY (INV).
For purchasing you have ORACLE PURCHASE ORDER (PO).
For dispatch of goods to customer you have ORACLE SHIPPING.
And for taking care of finance you have ORACLE GENERAL LEDGER (OM), ORACLE RECEIVABLE (OM), ORACLE PAYABLE (AP).

I think this will give you a brief idea what we are dealing with.....

Labels:

Audience for This Page:

Hey Friends,
The basic idea for creating this blog is to have a Technical information about Oracle Applications. Let me tell you my experience when I started learning Oracle Applications the main problem I faced was that every time I searched the net seeking a technical help about the Oracle Application I was disappointed.
So I decide to have one such place where you will have a real TECHNO-FUNCTIONAL knowledge of Oracle Applications.
Starting from a top view of Oracle Application and all the important modules involved I will take you the technical intricacies. So anyone who is willing to start learning APPS or the one who is already using it can make use of this page.
So here starts your journey ………. I wish you a very Happy Learning….!!!!!


Regards,
Anil

Labels: