Every running Oracle database is associated with an Oracle instance. When a
database is started on a database server (regardless of the type of computer),
Oracle allocates a memory area called the System Global Area (SGA) and starts
one or more Oracle processes. This combination of the SGA and the Oracle
processes is called an Oracle instance. The memory and processes of an instance
manage the associated database’s data efficiently and serve the one or multiple
users of the database.
The Instance and the Database
After starting an instance, Oracle associates the instance with the specified
database. This is called mounting the database. The database is then ready to be
opened, which makes it accessible to authorized users.
Multiple instances can execute concurrently on the same computer, each accessing
its own physical database. In clustered and massively parallel systems (MPP),
the Oracle Parallel Server allows multiple instances to mount a single database.
Only the database administrator can start up an instance and open the database.
If a database is open, the database administrator can shut down the database so
that it is closed. When a database is closed, users cannot access the
information that it contains.
Security for database startup and shutdown is controlled via connections to
Oracle with administrator privileges. Normal users do not have control over the
current status of an Oracle database.
Q: What is a view?
View
A view is a tailored presentation of the data contained in one or more tables
(or other views). Unlike a table, a view is not allocated any storage space, nor
does a view actually contain data; rather, a view is defined by a query that
extracts or derives data from the tables the view references. These tables are
called base tables.
Views present a different representation of the data that resides within the
base tables. Views are very powerful because they allow you to tailor the
presentation of data to different types of users.
Views are often used to:
• provide an additional level of table security by restricting access to a
predetermined set of rows and/or columns of a table
• hide data complexity
• simplify commands for the user
• present the data in a different perspective from that of the base table
• isolate applications from changes in definitions of base tables
• express a query that cannot be expressed without using a view
What is referential integrity?
Rules governing the relationships between primary keys and foreign keys of
tables within a relational database that determine data consistency. Referential
integrity requires that the value of every foreign key in every table be matched
by the value of a primary key in another table.
Tech Interviews comment by JH Surya Kanth
2.Name the data dictionary that stores user-defined constraints?
USER_CONSTRAINTS
Tech Interviews comment by Krishna
3.What is a collection of privileges?
user_tab_privs_made
user_tab_privs_recd
Tech Interviews comment by Krishna
4.Snapshot: A snapshot is a read-only copy of a table or a subset of a table.
Tech Interviews comment by Krishna
5.Can i execute Stored Procedures & Functions from SQL prompt ? If yes how can i execute ?
Tech Interviews comment by Koteswara Rao
6.Hi Krishna What is a collection of privileges?
collection of privilages is role.
sasi242@yahoo.com
Tech Interviews comment by Sasidhar
7.What is a cursor?
Ans:
cursor is a private sql work area used to perform manipulations on data using pl\sql.
adv:
1.mainly used for multiple row manipulations and locking columns.
note: data which is populated into the cursor is known as active dataset.
cursors are of two types
1.implicit
2.explicit
implicit
———
attributes or properties for implicit cursor
1.sql%is open:attribute returns a boolean value stating wether the cursor is open or closed.
2.sql % found: returns boolean value stating whether the record is found in the cursor.
3.sql%notfound : returns a boolean value stating whether the record is not found in the cursor
4.sql %rowcount :returns a pneumeric value stating no.of rows executed in the cursor.
explicit cursors—retrives multiple rows.
************
adv: users can perform locks on th data in the cursor
attributes
1.% is open
2.% found
3.% not found
4.% rowcount
Note: DATA which is populated in the cursor is known as active data set.
WE CAN WRITE TWO CURSORS IN ONE PROGRAM
WE CAN WRITE A CURSOR SPECIFYING PARAMETERS
CURSOR WITH UPDATE CLAUSE IS USED TO PERFORM LOCKS ON DATA.
Happy Coding
sasi242@yaho.com
Tech Interviews comment by Sasidhar
8.What is a sequence?
Ans:It is a database object to auto generate numbers.
Happy Coding
sasi242@yahoo.com
Tech Interviews comment by Sasidhar
9.Name the data dictionary that stores user-defined Stored procedures?
ans :- user_objects
Tech Interviews comment by Aravind Kumar
10.hi ,
i would like know more about sql advanced queries .
11.Question:Why Use Sql* Loader in Oracle Database?
Answer: The Sql Loader module of the oracle database Management System loads data into an existing ORACLE table from an external files.It is available locally only on CMS and PCs with oracle version 5. Throughout this documentation the CAR database described in Referance A is used for illustration.
There are several methods others than using SQL *Loader of inserting data into a table.
1. The Sql insert command may be used from the SQL * Plus module,
for Example :
insert into CAR values(…)
where the values to be inserted into a row of the table are listed inside the parentheses. Dates and Characters data must be Surrounded by single quotes; items are seperated by commas.
2. Sql*Forms allows you to add rows interactively using forms. The forms may contain default values and checks for invalid data.
3. ODL loads the table from a control file and separate fixed format data file. ODL is available on all versions of ORACLE . SQL * Loader is much more flexible than ODL and will eventually supersede it on all systems.
Suppose i am created a function add which returns the addition of two numbers then
select add(3,4) from dual;
7
ODBC stands for open database connectivity
trigger is a stored procedure which auotomatically fired on a table whenever any dml operation is affected in the table.
we can create ddl trigger,database trigger(logon,logoff,startup,startoff),audit triggers
pseudo column the column which does not exist in a table
ex;rownum,rowid,level etc
Tech Interviews comment by Dinkocet
13.Thanks a lot for providing answers for the above questions…i am grateful to all of you
Regards
Ravi Prakash
Tech Interviews comment by Ravi Prakash
14.Answer to some of the questions above:
ODBC stands for Open Database Connectivity. It is used to connect the frontend with the backend(database)
Normalization is the techinque of designing the database with the least redundancy and duplicacy of data. Types of Normalization:
1 NF
2 NF
3 NF
BCNF
5 NF
6NF : Impossible to achieve this level of normalization
Tech Interviews comment by Vick
15.hi
i have problem with import
i have export file on linux os and oracle8i
i want import on windows platform
what should i do?
Tech Interviews comment by rekhalal
16.Hi Krishna ,
Thanks a lot for the Answers
Tech Interviews comment by sangeetha
17.Hi All,
Thank you for all posting the Q & A.
Tech Interviews comment by Pranesh
18.what is a synonym ?
Ans. A synonym is an alternative name for tables,views,procedures and other database objects
generally when we have more than one schema and we wish to access an object of a different schema then we create synonyms for that object in the schema where we wish to access the object.
Syntax:
create synonym synonym-name for schemaname.object-name
what is an exception ?
Exception is an event that causes suspension of normal program execution.
In oracle there are serveral types of exceptions
1) Pre-defined exceptions like NO_DATA_FOUND,TOO_MANY_ROWS
2) User-defined exceptions which would validate the business logic
3) unnamed system exceptions which are raised due to errors in the application code .. you can name these exceptions using PRAGMA EXCEPTION_INIT
4)Unnamed programmer-defined exceptions. Exceptions that are defined and raised in the server by the programmer. In this case, the programmer provides both an error number (between -20000 and -20999) and an error message, and raises that exception with a call to RAISE_APPLICATION_ERROR.
for all the exceptions raised oracle fills in sqleerm and sqlcode variable which provide the error message and error code for the exception raised.
What are pseudo-columns in SQL? Provide examples?
A pseudocolumn behaves like a table column, but is not actually stored in the table. You can select from pseudocolumns, but you cannot insert, update, or delete their values.
Examples:
CURRVAL,NEXTVAL,ROWID,LEVEL
what is a schema ?
A schema is a oracle database user account.
Tech Interviews comment by Rajesh B
19.What is a schema ?
A database user account is called a schema.
Tech Interviews comment by thevampirea@yahoo.co.in
20.What is a schema ?
A schema is a logical collection of database objects like tables, views, pkgs, procedures, triggers, etc. It usually has an associated database user.
Tech Interviews comment by Anil Kuppa
21.this is just to subscribe
Tech Interviews comment by Natraj
22.What is a co-related sub-query?
It is very similar to sub-queries where the parent query is executed based on the values returned by sub-quries. but when come’s to co-related subqueries for every instance of parent query subquery is executed and based on the result od sub-query the parent query will display the record as we will have refernce of parent quries in su-queries we call these as corelated subquries.
so, we can define co-related sub query as for every record retrival from the sub query is processed and based on result of process the parent record is displayed.
Tech Interviews comment by Natraj
23.wht is the major difference b/w oracle 8i & 9i
Tech Interviews comment by renjith
24.what is trigger?
Trigger is an event. It is used prevent the invalid entries of the data.There
has a different types of trigger are available.
1)rowlevel trigger
before insert,before delete,before update
after insert,after delete,after update
2)statement level trigger
before insert,before delete,before update
after insert,after delete,after update
3)INSTEAD OF trigger
4)Schema level Triggers
5)System level Triggers
25.co-related sub-query - I assume you mean correlated sub-query?
Tech Interviews comment by Mark
26.Hi
i want to get information about coalescing to tablespace?
Send theinformation to me through the mail id i have mentioned above.
Regards
Lucky
Tech Interviews comment by Lucky
27.i want to know how to use rownum and rowid efficiently in sql*plus queries
Tech Interviews comment by sudha
28.hi
will u plezzzz tell me
can we return cursor in the function if yes than what the process?
can we define exceptions twice in same block?
what is max. no. of statment that can specified in triggers?
in cursor where the cursor variable used in package body?
29.is there any solution to delete a particular colum in a database by sql
Tech Interviews comment by manraj
30.How can I assigned two table in a single block (database block) in forms6i?
Tech Interviews comment by Sudipta
31.Q. Is there any solution to delete a particular colum in a database by sql?
A. This is cant be done in versions before 9i.
In 9i
SQL> alter table delete column ;
Tech Interviews comment by Gaurav Sachan
32.pseudo columns in sql are currval and nextval.These are used with sequences to retreive the next sequence value and current sequence value.
The usage is as follows
suppose abc is the sequence name if i want to see the currval of the sequence we issue the sql statement
select abc.currval from dual;
if we want to see the next value of the sequence we issue the command
select abc.nextval from dual;
Tech Interviews comment by satish
33.Hi here i would like to give simple answer for question #1
What is an oracle instance?
An Oracle instance consists of the System Global Area (SGA) memory structure and the background processes used to manage a database. An instance is identified by using methods specific to each operating system. The instance can open and use only one database at a time.
Srinivasa Reddy
Tech Interviews comment by Srinivasa Reddy
34.hi,
what is the major difference between normal FOR LOOP and CURSOR LOOP?
-Regards
Muttappa S.T.
Tech Interviews comment by Muttappa S.T.
35.Hi,
when we install the new version of Oracle then what happens to our earlier forms?
Tech Interviews comment by Ujjwala
36.what is overloading of packages in oracle
Tech Interviews comment by jyothi
37.is it possible to create a cursor which is based on more than one table.
Tech Interviews comment by vasundhara
38.The correct answer for this question is
Q. Is there any solution to delete a particular colum in a database by sql?
A. alter table drop column
or
first mark the column unused
alter table set unused column
then drop it
alter table drop unused columns.
This will drop all the columns marked as unused. If a particular column has to be dropped, mention the column name after columns
A schema is a collection of logical objects owned by a user. A user in that regard is an account registered with the Oracle server.
Once u login into ur account/user, u can access other user’s schema objects like i can write scott.emp, if at all i’ve acces to scott user’s emp table.
Tech Interviews comment by rahul
40.Data Model: The logical data structure developed during the logical database design process is a data model or entity model. It is also a description of the structural properties that define all entries represented in a database and all the relationships that exist among them.
%ROWTYPE is used to declare a record with the same types as found in the specified database table, view or cursor
%TYPE is used to declare a field with the same type as that of a specified table’s column.
Index for a physical structure (b-tree) to help you query run faster.
Table partition is a method of breaking a large table into smaller tables grouped by some logical separators. in your case, having both index and partition will make things faster.
Data Control statements
These are used to control the data using DCL (data control language) ex: Grant etc.
Trigger : A program in a database that gets called each time a row in a table is INSERTED, UPDATED, or DELETED. Triggers allow you to check that any changes are correct, or to fill in missing information before it is commited. Triggers are normally written in PL/SQL or Java.
Relation: Mathematical term for a table.
Redo Log: A set of files that record all changes made to an Oracle database. A database MUST have at least two redo log files. Log files can be multiplexed on multiple disks to ensure that they will not get lost. Also see thread.
Oracle ARCHiver Process. ARCH is an Oracle background process created when you start an instance in ARCHIVE LOG MODE. The ARCH process will archive on-line redo log files to some backup media.
Buffer Cache: The portion of the SGA that holds copies of Oracle data blocks. All user processes that connect to an instance share access to the buffer cache. Performance of the buffer cache is indicated by the BCHR (Buffer Cache Hit Ratio).
Background Process: Non-user process that is created when a database instance is started. These processes are used to manage and monitor database operations. Example background processes: SMON, PMON etc.
Two-Phase Commit: A strategy in which changes to a database are temporarily applied. Once it has been determined that all parts of a change can be made successfully, the changes are permanently posted to the database. The steps involved are the “prepared” and “commit request”
Union: All the distinct rows are selected by either query.
Intersect: All distinct rows selected by both queries
Minus: All distinct rows that are selected by the first SELECT statement and that are not selected in the second SELECT statement.
Join: The process of combining data from two or more tables using matching columns. Types of join are Equi Join, Outer Join, Self Join, Natural Join, etc.
Equi Join: An Equi Join (aka. Inner Join or Simple Join) is a join statement that uses an equivalency operation (i.e: colA = colB) to match rows from different tables. The converse of an equi join is a nonequijoin operation.
Outer Join: Similar to the Equi Join, but Oracle will also return non matched rows from the tale with the outer join operator (+). Missing values are filled with null values.
Self Join: A join in which a table is joined with itself.
Natural Join: A join statement that compares the common columns of both tables with each other. One should check whether common columns exist in both tables before doing a natural join.
Integer Data Types: VARCHAR2 (Size), NUMBER (Precision, Size)
Denormalization: The opposite of data normalization (almost). In a denormalized database, some duplicated data storage is allowed. The benefits are quicker data retrieval and/or a database structure that is easier for end-users.
A packaged business software system that lets a company automate and integrate the majority of its business processes; share common data and practices across the enterprise; [and] produce and access information in a real-time environment.
2) Tell me some thing about SQL-LOADER.
Sql * loader is a bulk loader utility used for moving data from external files into the oracle database.
Sql * loader supports various load formats, selective loading, and multi-tables loads.
1) conventional
--The conventional path loader essentially loads the data by using standard ‘insert’ statement.
2) direct
-- the direct path loader (direct = true) by possess of logic involved with that, and loads directly in to the oracle data files.
EX:-
My data.csv file
1001, “scott tiger”,1000,40
1002,”gvreddy”,2345,50
Load data
Infile ‘c:\data\mydata.csv’
Into table emp
Fields terminated by “,” optionally enclosed by ‘”’
3) how do u dump data from pl/sql block to flat files?
Using utl_file package, we can dump data from pl/sql block to flat file.
PRE-REQUIREMENTS for UTL_FILE is specify the accessible directories for the UTL_FILE function in the initialization file (INIT.ORA) Using the UTL_FILE_DIR parameters.
Ex: UTL_FILE_DIR =
EX:-
--remember to update INITSID.ORA,
--utl_file_dir = ‘c:\oradata’
Declare
Fp utl_file.file_type;
Begin
Fp := utl_file.fopen(c:\oradata’,tab1.txt’,’w’);
Utl_file.putf(fp,’%s %s \n ‘text field’, 55);
Utl_file.fclose(fp);
End;
4) What is SET-OF-BOOKS?
Collection of Chat of Accounts and Currency and Calendars is called SOB
5)What is the interface?
Interface Table is a table which is used as medium for transfer of data between two systems.
6)What is invoice?
Send you a request for payment
7)What is INBOUND and OUT BOUND? (Different types of interfaces)
Inbound Interface:
For inbound interfaces, where these products are the destination, interface tables as well as supporting validation, processing, and maintenance programs are provided.
Outbound Interface:
For outbound interfaces, where these products are the source, database views are provided and the destination application should provide the validation, processing, and maintenance programs
8)Tell me what r the Base tables in the AR?
hz_parties(party_id)(store info about org, groups and people)
HZ_PARTIES stores information about parties such as organizations, people, and groups, including the identifying address information for the party.
hz_cust_accounts (cust_account_id)
HZ_CUST_ACCOUNTS stores information about customer relationships. If a party becomes a customer, information about the customer account is stored in this table. You can establish multiplecustomer relationships with a single party, so each party can have multiple customer account records in this table.
hz_cust_acct_sites_all(cust_acct_site_id)
HZ_CUST_ACCT_SITES_ALL stores information about customer sites.One customer account can have multiple sites. The address is maintained in HZ_LOCATIONS.
hz_cust_site_uses_all(site_use_id)
HZ_CUST_SITE_USES_ALL stores information about site uses or business purposes. A single customer site can have multiple site uses, such as bill to or ship to, and each site use is stored as a record in this table.
hz_party_sites (party_site_id)
HZ_PARTY_SITES stores information about the relationship between Parties and Locations. The same party can have multiple party sites.Physical addresses are stored in HZ_LOCATIONS.
hz_locations (location_id)
HZ_LOCATIONS stores information about physical locations.
hz_Person_Profiles (person_profile_id)
HZ_PERSON_PROFILES stores detail information about people.
HZ_ORGANIZATION_PROFILES stores credit rating, financial statistics, socioeconomic and corporate linkage information for business sites. The primary key for this table is ORGANIZATION_PROFILE_ID.
9)What r the table’s interface tables in the customer interface tables?
1)Ra_customers_interface_all
This table stores customer, address, and business purpose information. You do not have to enter values in this table if you do not want to import customers, addresses, or business purposes.
ADDRESS1 through 4
Enter the address for your customer in these four columns. You can enter up to four lines of an address.
Validation:
If you enter a value in ORIG_SYSTEM_ADDRESS_REF, you must enter a value in ADDRESS1. For multiple rows with the same address reference, insert values in address 1–4.
Destination:HZ_LOCATIONS.ADDRESS1,
HZ_LOCATIONS.ADDRESS2,
HZ_LOCATIONS.ADDRESS3,
HZ_LOCATIONS.ADDRESS4
2) Ra_customer_profile_int_all
A customer level profile must exist in A_CUSTOMER_PROFILES_INTERFACE for new customers and each bill–to business purpose.
3) Ra_contact_phones_int_all
This table stores telephone numbers for customers, addresses and contacts as well as contacts for customers and addresses.
4) Ra_customer_banks_int_all
This table stores bank information for a customer or for a specific Bill–To address, you must enter a bank account for this customer,
5) Ra_cust_paymethod_int_all
To import payment methods for customers and bill–to business purposes,
10) What r the staging tables in the customer interface?
Ra_customers_stg
Ra_customers_address_stg
Ra_customers_point_stg
Ra_customers_contact points_stg
Ra_customers_relate_stg
Ra_customer_error.
11)Tell me some mandatory columns in the customer interface tables?
a) Ra_customers_interface_all
1) Orig_system_customer_ref
2) insert_update_flag
3) customer_number
4) customer_status
5)last_updated_by
6) last_updated_date
7)created_by
8) creation_date.
b) Ra_customer_profile_int_all
1) customer_profile_class_name
c) Ra_contact_phones_int_all
1)orig_system_telephone_ref
2)telephone
3) telephone_type
d) Ra_customer_banks_int_all
1) bank_a/c_name
2)bank_a/c_no
3)bank_a/c_currency_code
e) Ra_cust_paymethod_int_all
1) payment_method_name
12)Tell me the Navigation for customer interface?
Receivables à Interface à Customers
1. What tables cannot be updated through customer interface?
No updates will be allowed to be made through customer interface for
Following tables
RA_SITE_USES_ALL
RA_CUSTOMER_RELATIONSHIPS_ALL
RA_CUST_RECEIPT_METHODS
AP_BANK_BRANCHES
AP_BANK_ACCOUNTS_ALL
AP_BANK_ACCOUNT_USES_ALL
2. How to send additional customer and address information through customer interafce
Here is where attribute columns are used.
* Additional Customer data can be populated in
RA_CUSTOMERS_INTERFACE_ALL.customer_attribute1 to 15
This will go into RA_CUSTOMERS.attribute1 to 15
* Additional address information can be populated in
RA_CUSTOMERS_INTERFACE_ALL.address_attribute1 to 15
This will go into RA_ADDRESSES_ALL.attribute1 to 15
And so on.
5. What should be the batch size (number of customer records) general guidelines for optimal performance
About 10,000 records per bacth is ideal, it is suggested to keep the batch
size small.
6. Why does customer interface error out if there is mismatch in address information?
Because the code validates against these mismatches.
arplscin.sql and arplbcin.sql
It validates the address being inserted or updated with respect to the tax
location flexfield structure. For each row being inserted or updated in
RA_CUSTOMERS_INTERFACE, and that has not already been marked in error,
the set_location_ccid function is called to return either an existing ccid
for the address entered or to create a new entry in AR_LOCATION_VALUES for
this new address. The RA_CUSTOMERS_INTERFACE record is then updated with the
value of the ccid returned.
7. How do you send records at customer level profile and address/site level profile?
For every customer record in RA_CUSTOMERS_INTERFACE_ALL, insert two records in table RA_CUSTOMER_PROFILES_INT_ALL. (Refer Note: 1070800.6 )
9. Does Customer Interface import salesperson data?
No, Refer Enhancement Bug: 147495
11. Customer Interface process can be used for updating the customer information How does the UPDATE work?
Current functionality of Customer Interface is to update all the data. You cannot run Customer Interface to update only changed data. (Refer Bug: 879121 for the intended functinality)
12. What are some of the important fields that Customer Interface does not load?
Not all fields in RA_CUSTOMERS are being loaded by the interface.
SIC_CODE
GSA_INDICATOR
FOB_POINT
SALES_CHANNEL_CODE
FREIGHT_TERM
WAREHOUSE_ID
PRICE LIST
SHIP_PARTIAL
PAYMENT_TERM_ID in RA_SITE_USES.PAYMENT_TERM_ID
(Refer Enhancement Request Bug: 245300)
13. New TCA/Customer Model, how to load customer as PERSON or ORGANIZATION through Customer Interface?
a) Populate ra_customers_interface_all . person_flag = 'Y'
Run Customer Interface process will load this record as PERSON
b) Populate ra_customers_interface_all . person_flag = 'N' ( or NULL )
Run Customer Interface process will load this record as ORGANIZATION
13) Tell me what is the procedure to develop an interface?
a.First we will get the Requirement document.
b.We will create control file based on that plot file.
c.Then the control files which loads the data into staging tables.
d.Through pl/sql programs we will mapping and validate the data and then dump into the interface tables.
e.Through the standard programs we will push the data from interfacetables to Base tables.
14)What validations u did in the customer interface?
a.customer name : the same customer reference can’t have different customer names with in this table
HZ_PARTIES.PARTY_NAME
b.customer number : must be null if your r using automatic customer numbering, must exit if you are not using automatic customer numbering. This value much be unique with in HZ_PARTIES
c.customer status : must be ‘A’ for active or ‘I’ for inactive
HZ_PARTIES_STATUS
d.bank account num or bank account currency code :
if the bank a/c already exist do not enter a value
if the bank a/c does not existyou must enter a value
e.bank a/c name : it must exist in AP_BANK_ACCOUNTS or if it does not exist values must exist for BANK_A/C_CURRENCY_CODE
BANK_A/C_NUM
BANK_NAME
BANK_BRANCH_NAME
Note : every interface table has two error msg
1)Error code.
2)Error msg.
15)How can u call a standard interface program from sql or pl/sql code?
Is the Functional and Technical behavior of Oracle Applications Package.
EX: - I want to assign the user3 responsibility to p4 printer then
System Administrator àProfile àSystem
(FND_PROFILE_OPTIONS)
19)Oracle E-Business suite?
Oracle apps + analytical components software.
(Oracle discover)
(Oracle sales analyzer)
(Oracle financial analyzer)
(Oracle marketing analyzer)
24) What is multi org?
“Legal entity has more than one operating unit is called as multi org”
a) Business group ---Human resources information is secured by
Business group
b) Legal entity.--- inter-company and fiscal/tax reporting.
Security à responsibility à operating unit.
c) Operating unit --- secures AR, OE, AP, PA and PO Information.
d) Organizations--- is a specialize unit of work at particular locations
25) What are the User PARAMETERS in the Reports?
P_CONC_REQUEST_ID
P_FLEX_VALUE
26)FND USER EXITS:-
FND SRWINITsets your profile option values,multiple organizations and allows Oracle Application Object Library user exits to detect that they have been called by an Oracle Reports program.
FND SRWEXIT ensures that all the memory allocated for AOL user exits have been freed up properly.
FND FLEXIDVALare used to display flex field information like prompt, value etc
FND FLEXSQLthese user exits allow you to use flex fields in your reports
FND FORMAT_CURRENCYis used to print currency in various formats by using formula column
26) PL/SQL stored procedure parameters?
orwhat are the two parameters that are mandatory for pl/sql type concurrent program?
Procedure/function (ERRBUFOUT
RETCODE OUT
………………….)
ERRBUF :-Used to write the error message to log or request file.
RETCODE :- Populate log request file with program submission details info.
27) What is Value Set?
--The value set is a collection (or) container of values.
--When ever the value set associated with any report parameters. It provides list of values to the end user to accept one of the values as report parameter value.
-- If the list of values needed to be dynamic and ever changing and define a table based values set.
27) What r the validation types?
1) None-------- validation is minimal.
2) Independent ------input must exist on previously defined list of values
3) Dependent------input is checked against a subset of values based on a
prior value.
3) Table----- input is checked against values in an application table
4) Special------values set uses a flex field itself.
5) Pair------ two flex fields together specify a range of valid values.
6) Translatable independent ----- input must exist on previously defined list
of values; translated values can be used.
7) Translatable dependent ------- input is checked against a subset of values
based on a prior values; translated value can be used.
28) Form development process?
a) open template form
b) Save as .fmb
c) Change the form module name as form name.
d) Delete the default blocks, window, and canvas
e) Create a window.
f) Assign the window property class to window
g) Create a canvas(subclass info)
h) Assign canvas property class to the canvas
I) assign the window to the canvas and canvas to the window
j) Create a data block
k) Modify the form level properties. (sub class item à Text item)
l) Modify the app_cusom package. In the program unit.
m) Modify the pre-form trigger (form level)
n) Modify the module level properties ((console window, First navigation
p) Save and compile the form.
Place the .fmx in the server directory.
Q) Register in the AOL
APPLICATION à FORM
APPLICATION à FUNCTION
APPLICATION à MENU
29)How do u customize the Reports?
a.Identify the Short name of the standard report in which module we have to customize
Ex: - if u want to customize in the AR module path is
Appl top\ar\11.5.0\reports\US\ .rdf
b.Open the .rdf file in Report builder and change the name of the module.
c.Open the data module and modify the query (what is client requirements) assign the columns to the attributes.
d.Go to report wizard and select, what r the newly created columns.
e.Then Compile it. Then u will get a .rep file in the specified module. If it is not in the specified directory then we have to put in the server directory.
f.Then Register in the AOLConcurrent àexecutable.
Concurrent à program.
g.go to system administrator SecurityàResponsibilityàrequest
h)Add and assign a concurrent program to a request group
30) Registering parametric report?
Any applications will have two parameters,
1) from-period2) to-period
a) Go to object navigator and create the parameters.
User parameters à from_no, to_no (data type char and width 30)
b) Open the report layout and write the query(we have to reg the table in AOL)
Select empno,ename,from g_emp where empno between :from_no and to_no
c) Compile and put the .RDP file in the server directory.
d) Registering in AOL.
Concurrent à executable
Concurrent à programthen go to “PARAMETERS”
e) Go to Application à validation àset.then go to “EDIT INTO”
After entering the VALUE SETS (1) And TOKENS (2)
f)Go to Administrations
Sequrity à responsibility à Request
h) Add and assign a concurrent program to a request group
31) Tell me some report names and their table names in GL, AP, AR, and PO?
1) ra_customer_trx_all
customer_trx_id
trx_number(invoice no, debit memo no, credit memo no)
cust_trx_type_id
2) ra_customer_lines_all (details of invoice)
cutomer_trx_id
3) ar_payment_schdules_all
check_id
This table stores all transactions except adjustments and miscellaneous cash receipts. Oracle Receivables updates this table when activity occurs against an invoice, debit memo, chargeback, credit memo, on account credit, or receipt.
4) ra_cust_trx_types_all(invoice types)
cust_trx_type_id
5) ra_batches_all
Batch_id
This table stores information about each receipt batch that you create in
Oracle Receivables. Each row includes information about a specific batch such as batch source, status, batch type, control count, and control amount
6) ra_receivable_application_all
7) ra_adjustments_all
This table stores information about your invoice adjustments. Each row includes general information about the adjustment you are making such as activity name, amount, accounting information, reason, and type of adjustment. You need one row for each adjustment you are making to an invoice.
8) ra_cash_receiots_all
Cash_receipt_id
This table stores one record for each receipt that you enter. Oracle Receivables creates records concurrently in the AR_CASH_RECEIPT_HISTORY_ALL, AR_PAYMENT_SCHEDULES_ALL, and AR_RECEIVABLE_APPLICATIONS tables for invoice–related receipts.
AP_CHECKS_ALL stores information about payments issued to suppliers or refunds received from suppliers. You need one row for each payment you issue to a supplier or refund received from a supplier. Your Oracle Payables application uses this information to record payments you make to suppliers or refunds you receive from suppliers.
7)ap_accounting_events_all
8)ap_bank_accounts_all
AP_BANK_ACCOUNTS_ALL contains information about your bank accounts. You need one row for each bank account you define. Each bank account must be affiliated with one bank branch. When you initiate an automatic payment batch, enter a manual check, or create a Quick payment, you can select a bank account that you define in this table.
9)ap_bank_accounts_uses_all
AP_BANK_ACCOUNT_USES_ALL stores information for the internal and external bank accounts you define in Oracle Payables and Oracle
Receivables applications.
1)po_vendors_all
2)po_vendors_sites_all
3)po_headers_all
po_header_id
4)po_lines_all
po_line_id
5)po_line_locations_All
6)po_distributions_all
po_distribution_id,
1)Gl_code_combinations
GL_CODE_COMBINATIONS stores valid account combinations for each Accounting Flexfield structure within your Oracle General Ledger application. Associated with each account are certain codes and flags, including whether the account is enabled, whether detail posting or detail budgeting is allowed, and others.
2)Gl_je_batches.
GL_JE_BATCHES stores journal entry batches.
3)Gl_je_headers
GL_JE_HEADERS stores journal entries. There is a one–to–many relationship between journal entry batches and journal entries. Each row in this table includes the associated batch ID, the journal entry name and description, and other information about the journal entry. This table corresponds to the Journals window of the Enter Journals form. STATUS is ’U’ for unposted, ’P’ for posted. Other statuses indicate that an error condition was found. A complete list is below.
4)Gl_je_lines.
GL_JE_LINES stores the journal entry lines that you enter in the Enter Journals form. There is a one–to–many relationship between journal entries and journal entry lines. Each row in this table stores the associated journal entry header ID, the line number, the associated code combination ID, and the debits or credits associated with the journal line. STATUS is ’U’ for unposted or ’P’ for posted
5)Gl_set of books
GL_SETS_OF_BOOKS stores information about the sets of books you define in your Oracle General Ledger application. Each row includes the set of books name, description, functional currency, and other information. This table corresponds to the Set of Books form.
6)Gl_periods
GL_PERIODS stores information about the accounting periods you define using the Accounting Calendar form. Each row includes the start date and end date of the period, the period type, the fiscal year, the period number, and other information. There is a one–to–many relationship between a row in the GL_PERIOD_SETS table and rows in this table.
1)OPEN-DEBIT MEMO REPORT?
This report shows all the open-debit memo transactions, based on customer number and dates.
The Report builder Built in package know as SRW Package This package extends reports ,Control report execution, output message at runtime, Initialize layout fields, PerformDDL statementsused to create or Droptemporary table,Call User Exist, to format width of the columns, to page break the column, to set the colors
Ex: SRW.DO_SQL, It’s like DDL command, we can create table, views , etc.,
SRW.SET_FIELD_NUM
SRW. SET_FILED_CHAR
SRW. SET FILED _DATE
37) Difference between Bind and Lexical parameters?
BIND VARIABLE :
-- are used to replace a single value in sql, pl/sql
-- bind variable may be used to replace expressions in select, where, group, order
by, having, connect by, start with cause of queries.
-- bind reference may not be referenced in FROM clause (or) in place of
reserved words or clauses.
LEXICAL REFERENCE:
-- you can use lexical reference to replace the clauses appearing AFTER select,
from, group by, having, connect by, start with.
-- you can’t make lexical reference in a pl/sql statmetns.
A placeholder is a column is an empty container at design time. The placeholder can hold a value at run time has been calculated and placed in to It by pl/sql code from anther object.
You can set the value of a placeholder column isina Before Report trigger.
Store a Temporary value for future reference. EX.Store the current max salary as records are retrieved.
A summary column performs a computation on another column's data.Using the Report Wizard or Data Wizard, you can create the following summaries:sum, average, count, minimum, maximum, % total.You can also create a summary column manually in the Data Model view, and use the Property Palette to create the following additional summaries:first, last, standard deviation, variance.
50) What is cursor?
A Cursor is a pointer, which works on active set, I.e. which points to only one row at a time in the context area’s ACTIVE SET. A cursor is a construct of pl/sql, used to process multiple rows using a pl/sql block.
28) Types of cursors?
1) Implicit: declared for all DML and pl/sql statements.
By default it selects one row only.
2) Explicit:Declared and named by the programmer.
Use explicit cursor to individually process each row returned by a
Multiple statements, is called ACTIVE SET.
Allows the programmer to manually control explicit cursor in the
Pl/sql block
a)declare: create a named sql area
b)Open: identify the active set.
c)Fetch: load the current row in to variables.
d)Close: release the active set.
CURSOR ATTRIBUTES
a)%is open: evaluates to true if the cursor is open.
b)%not found: evaluates to true if the most recent fetch does not return a row
c)%found: evaluates to true if the most recent fetch returns a row.
d)%row count: evaluates to the total number of rows returned to far.
Example for cursor:
1)Declare
Vno emp.empno%type;
Vname emp.ename %type;
Cursor emp_cursor is
Select empno,ename
From emp;
Begin
Open cursor;
For I in 1..10 loop
Fetch emp_cursor into vno,vname;
Dbms_output.putline(to_char(vno) ||’ ‘||vname);
End if;
E nd;
2)Begin
Open emp_cursor;
Loop
Fetch when emp_cursor % rowcount >10 or
Emp_curor % not found;
Bdms_output_put_line(to_char(vno)||’ ‘|| vname);
End loop;
Close emp_cursor;
End;
CURSOR FOR LOOP
A)cursor for loop is a short cut to process explicit cursors
B)it has higher performance
C)cursor for loop requires only the declaration of the cursor, remaining things like opening, fetching and close are automatically take by the cursor for loop
Example:
1)Declare
Cursor emp_cursor is
Select empno,ename
From emp;
Begin
For emp_record in emp_cursor loop
Dbms_output.putline(emp_record.empno);
Dbms_output.putline(emp_record.ename)
End loop
End;
Can we create a cursor without declaring it?
Yes – by using cursor for loop using subqueries.
BEGIN
FOR emp_record IN ( SELECT empno, ename
FROMemp) LOOP
-- implicit open and implicit fetch occur
IF emp_record.empno = 7839 THEN
...
END LOOP; -- implicit close occurs
END;
a) for update clause:
1) use explicit locking to deny access for the duration of a transaction
2) lock the rows before update or delete
Ex : select …….
From…….
For update[ of column ref] [no_wait]
b) where current of clause?
1) use cursor to update or delete the current row
Where current of <>
29) Attribute data types?
1) %type 2) %row type.
30) Exception Handilings?
Is a mechanism provided by pl/sql to detect runtime errors and process them with out halting the program abnormally
1)pre-defined
2)user-defined.
PRE-DEFINED:
1)cursor_already_open--------attempted to open an already open cursor.
2)Dup_val_on_index--------attempted to insert a duplicate values.
To execute a multi-row query, oracle opens an unnamed work area that stores processing information, to access the information, an explicit, which names the work area or, a cursor variable, which points to the work area.
where as a cursor always refers to the same query work area,a cursor variable can refer to a different work areas, cursor variable area like ‘c’ or ‘pascal’ pointers, which hold the memory location(address) of some object instead of the object itself.
So, declaring a cursor variable creates a pointers, not an object.
32) Can u define exceptions twice in same block?
No
33) Can you have two functions with the same name in a pl/sql block?
Yes
34) Can you have two stored functions with in the same name?
Yes
35) Can function be overload?
Yes
36)What is the maximum number of statements that can be specified in a trigger statement?
One.
32) Stored procedure?
Stored procedure is a sequence of statements that perform specific function.
53) What is procedure?
----is a named pl/sql block to perform a specific task.
----A procedure may have DML statements.
----It may or may not return a value.
----Procedure can return more than one value.
Example for procedure
1)To accept the year as a parameter and list emp belong to the year?
Create or replace
Procedure empy(y number) is
Cursor emp_cursor is
Select * from emp where to_char(hiredate,’yyyy’)=’y’;
Emp_recordemp%rowtype;
Begin
For emp_record in emp_cursor loop
Print (emp_record.empno);
Print (emp_record.ename);
Print (emp_record.sal);
End loop;
End;
Output :
var empx number;
Begin
:empx := ‘1234’;
End;
Exec empy(:empx);
Print empy;
54) What is function?
---- is a named pl/sql block to perform a specific task, is mainly used for calculation purpose.
---- A function is called as part of an exception.
---- Every function should return a value
Example for function
Create or replace
Function get_sal(p_id in emp.emp_no% type)
Return number
Is
v_sal emp.sal%type :=0;
Begin
Select salary into v_salary
From emp
Where emp_no = p_id;
Return v_salary
End get_sal;
End;
Output :
var g_sal number;
Exec :g_sal := get_sal(99);
Print g_salary;
9.Can functions be overloaded ?
Yes.
10.Can 2 functions have same name & input parameters but differ only by return datatype
No.
55) What is the package?
---- Group logically related pl/sql types, items and subprograms.
1)package specification
2)package body
Advantages of a package:
·Modularity
·Easier Application Design
·Information Hiding
·Overloading
You cannot overload:
•Two subprograms if their formal parameters differ only in name or parameter mode. (datatype and their total number is same).
•Two subprograms if their formal parameters differ only in datatype and the different datatypes are in the same family (number and decimal belong to the same family)
•Two subprograms if their formal parameters differ only in subtype and the different subtypes are based on types in the same family (VARCHAR and STRING are subtypes of VARCHAR2)
•Two functions that differ only in return type, even if the types are in different families.
56) What is FORWARD DECLARATION in Packages?
PL/SQL allows for a special subprogram declaration called a forward declaration. It consists of the subprogram specification in the package body terminated by a semicolon. You can use forward declarations to do the following:
• Define subprograms in logical or alphabetical order.
• Define mutually recursive subprograms.(both calling each other).
---- triggers are similar to procedures, in that they are the named pl/sql blocks with declarative, executable and exception-handling sections, how ever a procedure is executed explicitly from another block via a procedure call, which can also pass arguments.
---- A trigger is executed implicitly when ever a particular event task places. And is nothing but a event.
---- The triggering event is a DML (insert, update, delete) operations on a data base table
----- fires whenever a data event(such as DML) or system event(such as login or shutdown) occurs on a schema or database
Trigger timing :1) before
2) after
3) instead of ( this is used for views)
Triggering events : 1) insert
2)update
3) delete
Trigger type :1) statement level
2) row level.
Firing sequence of database triggers
1)before statement trigger
2)before row trigger
3)after row trigger
4)after statement trigger
Ex:
1)Create or replace trigger secure_emp
Before
Inserton emp
Begin
If (to_char(sysdate,’dy’) in(‘sat’,’sun’)) or
To_char(sysdate,’hh24:mi’)
Not between ’08:00’ and ’18:00’)
Then raise_application_error(-20500,’u can insert in the office timings’)
End if;
End;
Ex :-2)write a program to all transitions with name smith?
Create or replace
Trigger trigger_name
Before insert or update or delete
On emp
For each row
When (old.ename =’smith’ or
New.ename =’smith’)
Begin
Raise_application_error(-20003,’smith’);
End;
57) Difference between triggers and procedures?
Defined with create trigger
Defined with create procedure
The data dictionary contains source code in the user_triggers.
Data dictionary contains source code in user_source
Implicitly invoked
Explicitly invoked
Commit, save point and rollback are not allowed(TCL)
Those are allowed
58) LOCKS?
-- Is to reduce concurrency
1) share lock
---it allows the other users for only reading not to insert or update or delete.
2) exclusive lock
--- only one user can have the privileges of insert or update and delete of particular object
--- others can only read.
3) update lock
----multiple user can read, update delete
Lock levels :
1) table level2) table space 3) data base level.
58) What is template?
a) The TEMPLATE form is the required starting point for all development of new
Forms.
b) The TEMPLATE form includes platform–independent attachments of several
Libraries.
APPSCORE :- It contains package and procedures that are required of all forms to supportthe MENUS ,TOOLBARS.
APPSDAYPK :- It contains packages that control the oracle applications CALENDER FEATURES.
FNDSQF:- it contains packages and procedures for MESSAGE DICTONARY, FLEX FIELDS, PROFILES AND CONCURRENT PROCESSING.
CUSTOM :- it allows extension of oracle applications forms with out modification of oracle application code, you can use the custom library for customization such as zoom( such as moving to another form and querying up specific records)
59)What are ad-hoc reports?
Ans.:Ad-hoc Report is made to meet one-time reporting needs. Concerned with or formed for a
particular purpose. For example, ad hoc tax codes or an ad hoc database query
60) What is responsibility?
Is collection of menus, request security groups and data groups
Menus: collection of forms is nothing but menus
Request security groups: collection of programs.
Data groups: is a group of modules to be made accessible by the user through
Responsibility
System adminàsecurityàdefine
Securityàuseràdefine
61) What are different execution methods of executabls?
FlexRptThe execution file is wrnitten using the FlexReport API.
FlexSqlThe execution file is written using the FlexSql API.
HostThe execution file is a host script.
Oracle ReportsThe execution file is an Oracle Reports file.
PL/SQL Stored ProcedureThe execution file is a stored procedure.
SQL*LoaderThe execution file is a SQL script.
SQL*PlusThe execution file is a SQL*Plus script.
SQL*ReportThe execution file is a SQL*Report script.
SpawnedThe execution file is a C or Pro*C program.
ImmediateThe execution file is a program written to run as a subroutine of the concurrent manager. We recommend against defining new immediate concurrent programs, and suggest you use either a PL/SQL Stored Procedure or a Spawned C Program instead.
Composite Datatypes :
–PL/SQL TABLES
–PL/SQL RECORDS
-Nested TABLE
-VARRAY
What is the sequence of functions – group by,having,orderby in a select statements ?
Select…..
Group by…
Having…
Orderby..
Difference between User and Super User?
User : login user or front end user
Super user : it has full access of particular module