Sie sind auf Seite 1von 16

1 What are various joins used while writing SUBQUERIES?

=, , IN, NOT IN, IN ANY, IN ALL, EXISTS, NOT EXISTS.


2 What is a mutating table error and how can you get around it?
This happens with triggers. It occurs because the trigger is trying to update a
row it is currently using. The usual fix involves either use of views or tempora
ry
tables so the database is selecting from one while updating the other.
3 Describe the use of %ROWTYPE and %TYPE in PL/SQL
%ROWTYPE allows you to associate a variable with an entire table row. The %TYPE
associates a variable with a single column type.
4 What are the types of triggers?
There are 12 types of triggers in PL/SQL that consist of combinations of the
BEFORE,
AFTER, ROW, TABLE, and INSERT, UPDATE, DELETE and ALL key words:
BEFORE ALL ROW INSERT
AFTER ALL ROW INSERT
BEFORE INSERT
AFTER INSERT etc.
5 Give one method for transferring a table from one schema to another:
There are several possible methods, export-import, CREATE TABLE... AS SELECT, or
COPY.
6 What is the fastest query method for a table?
Fetch by rowid
7 global temporary table
The data in a global temporary table is private, such that data inserted by a
session can only be accessed by that session. The session-specific rows in a
global temporary table can be preserved for the whole session, or just for the
current transaction.
The ON COMMIT DELETE ROWS clause indicates that the data should be deleted at th
e
end of the transaction.
CREATE GLOBAL TEMPORARY TABLE my_temp_table (
column1 NUMBER,
column2 NUMBER
) ON COMMIT DELETE ROWS;

8 View
View is presentation of one or more table or it is a virtual table
View is database object is used to register the sql statement permanently in the
database
It is used to reduce the object size
It is to hide the complex data
It used for security purpose also
9 Correlated subquery
are used for row-by-row prcessing.Each
subquery is executed once for every row of the outer
query.It is one way of reading every row in a table and
camparing the values in each row againt the realted data.
SELECT first_name, salary, department_id
FROM employees OUTER
WHERE salary > (SELECT AVG (salary)
FROM employees
WHERE department_id = OUTER.department_id);
Each time a row from the outer query is processed,the inner
query is evaluated.

10 What is rowid?
It gives the location in the database where row is
physically stored.
ROWID is a pseudo column attached to each row of a table. It is 18 characters
long, blockno, rownumber are the
components of ROWID.

11 integrity constraint
which prevents the user from entering the duplicating into
tables or views is called integrity constraint
Ex: primary key constraint,foreign key constraint,unique
constraint,check constraint.

12 Referential integrity,
Referential integrity, also known as relational integrity, means that if a table
contains a foreign key column, then
every value in that column (except NULL, if it is allowed) will be found in the
primary key of the table that it is
related to, or reference

13 Explain UNION, MINUS, UNION ALL and INTERSECT?


INTERSECT - returns all distinct rows selected by both queries.
MINUS - returns all distinct rows selected by the first query but not by the
second.
UNION - returns all distinct rows selected by either query
UNION ALL returns all rows selected by either query, including all duplicates.

14 What is the usage of SAVEPOINTS?


SAVEPOINTS are used to subdivide a transaction into smaller parts. It enables
rolling back part of a transaction.
Maximum of five save points are allowed.

15 What is ON DELETE CASCADE?


When ON DELETE CASCADE is specified Oracle maintains referential integrity by
automatically removing dependent foreign key values if a referenced primary or
unique key value is removed

16 How many LONG columns are allowed in a table? Is it possible to use LONG
columns in WHERE clause or
ORDER BY?
Only one LONG column is allowed. It is not possible to use LONG column in WHERE
or
ORDER BY clause.

17 What are the pre-requisites to modify datatype of a column and to add a colum
n
with NOT NULL
constraint?
- To modify the datatype of a column the column must be empty.
- To add a column with NOT NULL constrain, the table must be empty.

18 Where the integrity constraints are stored in data dictionary?


The integrity constraints are stored in USER_CONSTRAINTS.

19 How do you make a Function and Procedure as a Private?


A) Functions and Procedures can be made private to a package by not mentioning
their declaration in the package specification and by just
mentioning them in the package body.

20 Explain database links using example


A database link is a schema object in one database that enables you to access
objects on another database. The other database need not be an Oracle Database
system.
Once you have created a database link, you can use it to refer to tables and vie
ws
on the other database.
In SQL statements, you can refer to a table or view on the other database by
appending @dblink to the table or view name. You can query a table or view on th
e
other database with the SELECT statement.
You can also access remote tables and views using any INSERT, UPDATE, DELETE, or
LOCK TABLE
statement.

21 How do we create a synonym - give an example? (3)


A synonym is an alternative name for objects such as tables, views,
sequences, stored procedures, and other
database objects.
The syntax for creating a synonym is:
create [or replace] [public] synonym [schema .] synonym_name
for [schema .] object_name [@ dblink];
The or replace phrase allows you to recreate the synonym (if it already exists)
without having to issue a DROP
synonym command.
create public synonym suppliers
for app.suppliers;
This first example demonstrates how to create a synonym called suppliers. Now,
users of other schemas can
reference the table called suppliers without having to prefix the table name wit
h
the schema named app. For
example:
select * from suppliers;
If this synonym already existed and you wanted to redefine it, you could always
use the or replace phrase as
follows:
create or replace public synonym suppliers
for app.suppliers;

22 AUTONOMOUS_TRANSACTION
An autonomous transaction is an independent transaction that is initiated by
another transaction, and executes without interfering with the parent transactio
n.
When an autonomous transaction is called, the originating transaction gets
suspended. Control is returned when the autonomous transaction does a COMMIT or
ROLLBACK
A trigger or procedure can be marked as autonomous by declaring it as PRAGMA
AUTONOMOUS_TRANSACTION
PROCEDURE test_autonomous
IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
insert ....
commit;
END test_autonomous;

23 What is a materialized view


A materialized view provides indirect access to table data by storing the result
s
of a query in a separate schema object.
CREATE MATERIALIZED VIEW employee AS select * from employees;
To refresh the view EXECUTE DBMS_MVIEW.REFRESH('employee');
drop materialized view employee;
CREATE INDEX HR.dept_id_pk123 ON HR.dgiri
(LOCATION_ID)
ALTER TABLE ggiri
ADD PRIMARY KEY (department_id)

24 What?s a PL/SQL table? Its purpose and Advantages?


PL/SQL tables are temporary array like objects used in a PL/SQL block. The colum
n
data type can belong to any scalar datatype.
DECLARE
TYPE r1 IS TABLE OF employees.first_name%TYPE
INDEX BY BINARY_INTEGER;
r2 r1;
i BINARY_INTEGER := 0;
BEGIN
FOR r3 IN (SELECT first_name
FROM employees)
LOOP
i := i + 1;
r2 (i) := r3.first_name;
DBMS_OUTPUT.put_line (r2 (i));
END LOOP;
END;

25 PL/SQL RECORD
A record is a group of related data items stored in fields, each with its
own name and datatype. A record containing a field for each item lets you treat
the data as a logical unit. Thus, records make it easier to organize and represe
nt
information.
DECLARE
TYPE r1 IS RECORD (
employee_id NUMBER (5),
first_name VARCHAR2 (10),
hire_date DATE
);
r2 r1;
BEGIN
SELECT employee_id,
first_name,
hire_date
INTO r2
FROM employees
WHERE employee_id = 101;
DBMS_OUTPUT.put_line (r2.employee_id || ' ' || r2.first_name || ' ' ||
r2.hire_date);
EXCEPTION
WHEN NO_DATA_FOUND
THEN
raise_application_error (-20023, 'INVALID EMPLOYEE NUMBER');
END;
101 Neena 21-SEP-89
Statement processed.

26 Nested tables and Varrays


Nested tables and Varrays can be stored in a database column of relational or
object table.
To manipulate collection from SQL, you have to create the types in the database
with the CREATE TYPE statement.
Nested tables
CREATE OR REPLACETYPE [schema. .] type_name
[] { IS | AS } TABLE OF datatype;
Varrays
CREATE OR REPLACETYPE type_name
[] [schema. .]{ IS | AS } { VARRAY | VARYING ARRAY } ( limit ) OF datatype;

27 What is a Cursor? How many types of Cursor are there?


Cursor is a private SQL area created in SGA (System Global Area)to do multi row
operation in a PL/SQL programme .
There are three types of cursors. They are
Implicit Cursor: System (Oracle) automatically declares and uses for all DML SQL
Statements.
Explicit Cursor: Cursor declared explicitly in the PL/SQL programme to do multi
row operation
Dynamic Cursors Ref Cursors( used for the runtime modification of the select
querry).
Declaring the cursor, Opening the cursor, Fetching data , Closing the
cursor(Releasing the work area) are the steps involved when using explicit
cursors.

28 What is a cursor for loop ?


Cursor for loop implicitly declares %ROWTYPE as loop index,opens a cursor,
fetches rows of values from active set into fields in the record and closes
when all the records have been processed.
FOR emp_rec IN C1 LOOP
salary_total := salary_total +emp_rec sal;
END LOOP;
29 What are cursor attributes
%ROWCOUNT
%NOTFOUND
%FOUND
%ISOPEN

30 Explain ref cursors. What are the types of ref cursors?


Ref Cursor is a PL/SQL Datatype. This is used to store result of a query. Ref
cursor is a dynamic cursor with which we can change our
query contents at run time. Ref cursor is used in situations when you want to
encapsulate logic within sub-program i.e. your query is
changing depending on certain criterian.
There are 2 types in this.
if a ref cursor should not return any value then it is called as weak ref cursor
and if a cursor returns the value
then it is strong ref cursor.
weak ref cursors are more flexible because you can associate a weakly typed
cursor varible to any query

31 What is the difference between When no data Found and cursor attribute % DATA
FOUND?
When no Data Found is a predefined internal exception in PLSQL.
Where as % Data found is a cursor attribute that returns YES when zero rows are
retrieved and returns NO when at least one row is retrieved.

32 When do you use Ref Cursors?


We base a query on a ref cursor when you want to:
i) More easily administer SQL
ii) Avoid the use of lexical parameters in your reports
iii) Share data sources with other applications, such as Form Builder
iv) Increase control and security
v) Encapsulate logic within a subprogram

33 How do you open and close a cursor variable. Why it is required?


Using OPEN cursor_name and CLOSE cursor_name commands. The cursor must be opened
before using it in order to fetch the result set of the query it is associated
with.
The cursor needs to be closed so as to release resources earlier than end of
transaction, or to free up the cursor variable to be opened again.

34 What should be the return type for a cursor variable. Can we use a scalar dat
a
type as return type?
The return type of a cursor variable can be %ROWTYPE or record_name%TYPE or a
record type or a ref cursor type. A scalar data type like number or varchar cant
be used but a record type may evaluate to a scalar value.

35 What is use of a cursor variable? How it is defined?


Cursor variable is used to mark a work area where Oracle stores a multi-row quer
y
output for processing. It is like a pointer in C or Pascal. Because it is a TYPE
,
it is defined
as TYPE REF CURSOR RETURN ;

36 What WHERE CURRENT OF clause does in a cursor?


The Where Current Of statement allows you to update or delete the record that wa
s
last fetched by the cursor.

37 Without closing the cursor, If you want to open it what will happen. If error
,
get what is the error?
If you reopen a cursor without closing it first,PL/SQL raises the predefined
exception CURSOR_ALREADY_OPEN.
39 What are Exceptions? How many types of Exceptions are there?
Exceptions are conditions that cause the termination of a block. There are two
types of exceptions
Pre-Defined Predefined by PL/SQL and are associated with specific error
codes.
User-Defined Declared by the users and are rose on deliberate request.
(Breaking a condition etc.)
Exception handlers are used to handle the exceptions that are raised. They
prevent exceptions from propagating out of the block and define actions to be
performed when exception is raised.

40 What is a Pragma Exception_Init? Explain its usage?


Pragma Exception_Init is used to handle undefined exceptions. It
issues a directive to the compiler asking it to associate an exception to the or
acle
error. There by displaying a specific error message pertaining to the error occu
rred.
Pragma Exception_Init (exception_name, oracle_error_name).

41 What is a Raise and Raise Application Error?


A) Raise statement is used to raise a user defined exception.
B) A raise application error is a procedure belonging to dbms_standard package.
It
allows to display a user defined error message from a stored subprogram.

42 What is the difference between Package, Procedure and Functions?


A package is a database objects that logically groups related PL/SQL types, obje
cts, and
Subprograms.
Procedure is a sub program written to perform a set of actions and can return mu
ltiple values.
Function is a subprogram written to perform certain computations and return a si
ngle value.
Unlike subprograms packages cannot be called, passed parameters or nested.

43 How do you make a Function and Procedure as a Private?


Functions and Procedures can be made private to a package by not mentioning thei
r declaration in the
package specification and by just mentioning them in the package body.

44 What is a Raise and Raise Application Error?


A) Raise statement is used to raise a user defined exception.
B) A raise application error is a procedure belonging to dbms_standard package.
It
allows to display a user defined error message from a
stored subprogram.

45 What is the difference between Package, Procedure and Functions?


? A package is a database objects that logically groups related PL/SQL types,
objects, and
Subprograms.
? Procedure is a sub program written to perform a set of actions and can return
multiple values.
? Function is a subprogram written to perform certain computations and return a
single value.
Unlike subprograms packages cannot be called, passed parameters or nested.

46 What is a Trigger ? How many types of Triggers are there?


Trigger is a procedure that gets implicitly executed when an insert /
update / delete statement is issued against an associated table. Triggers can on
ly be
defined on tables not on views, how ever triggers on the base table of a view ar
e
fired if an insert/update/delete statement is issued against a view.
There are two types of triggers,
Statement level trigger and Row level trigger.
Insert
After / For each row
Trigger is fired / Update /
Before / For Each statement
Delete

47 How can you rebuild an index?


ALTER INDEX <index_name> REBUILD;

48 You have just compiled a PL/SQL package but got errors, how would you view th
e
errors?
SHOW ERRORS

49 Can a function take OUT parameters. If not why?


yes, IN, OUT or IN OUT.

50 Can the default values be assigned to actual parameters?


Yes. In such case you dont need to specify any value and the actual parameter wi
ll
take the default value provided in the function definition.

51 What is difference between a formal and an actual parameter?


The formal parameters are the names that are declared in the parameter list of t
he
header of a module. The actual parameters are the values or expressions placed i
n
the parameter list of the actual call to the module.

52 Can cursor variables be stored in PL/SQL tables. If yes how. If not why?
Yes. Create a cursor type - REF CURSOR and declare a cursor variable of that typ
e.
DECLARE
/* Create the cursor type. */
TYPE company_curtype IS REF CURSOR
RETURN company%ROWTYPE;
/* Declare a cursor variable of that type. */
company_curvar company_curtype;
/* Declare a record with same structure as cursor variable. */
company_rec company%ROWTYPE;
BEGIN
/* Open the cursor variable, associating with it a SQL statement. */
OPEN company_curvar FOR
SELECT *
FROM company;
/* Fetch from the cursor variable. */
FETCH company_curvar
INTO company_rec;
/* Close the cursor object associated with variable. */
CLOSE company_curvar;
END;

53 How do you pass cursor variables in PL/SQL?


Pass a cursor variable as an argument to a procedure or function. You can, in
essence, share the results of a cursor by passing the reference to that result
set.

54 When you use WHERE clause and when you use HAVING clause
HAVING clause is used when you want to specify a condition for a group function
and it
is written after GROUP BY clause
The WHERE clause is used when you want to specify a condition for columns, singl
e
row functions except group functions and it is written before GROUP BY clause if
it is
used.

55 Which is more faster - IN or EXISTS


EXISTS is more faster than IN because EXISTS returns
a Boolean value whereas IN returns a value.

56 What is a pseudo column. Give some examples


It is a column that is not an actual column in the
table.
eg USER, UID, SYSDATE, ROWNUM, ROWID, NULL, AND LEVEL.
57 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 thei
r
values. Examples: CURRVAL,NEXTVAL,ROWID,LEVEL

58 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.

59 What is a mutating table error and how can you get around it?
This happens with triggers. It occurs because the trigger is trying to update a
row it is currently using. The usual fix involves either use of views or tempora
ry
tables so the database is selecting from one while updating the other.

60 What is Overloading of procedures ?


The same procedure name is repeated with parameters of different datatypes and
parameters in different positions, varying
number of parameters is called overloading of procedures.
E.g. DBMS_OUTPUT.PUT_LINE

61 What is SQLCODE?
A predefined symbol that contains the Oracle error status of the previously
executed PL/SQL statement. If a
SQL statement executes without errors, SQLCODE is equal to 0.

62 What is SQLERRM?
A PL/SQL symbol that contains the error message associated with SQLCODE. If a SQ
L
statement executes
successfully, SQLCODE is equal to 0 and SQLERRM contains the string ORA-0000:
normal, successful completion

63 What is an inline view?


A sub query in the from clause of your main query.

64 What is a Synonym ?
A synonym is an alias for a table, view, sequence or program unit.

65 What are the types of Synonyms?


There are two types of Synonyms Private and Public.

66 What is a Private Synonyms ?


A Private Synonyms can be accessed only by the owner.

67 What is a Public Synonyms ?


A Public synonym can be accessed by any user on the
database.

68 What are synonyms used for ?


--Synonyms are used to : Mask the real name and owner of an object.
---Provide public access to an object
--Provide location transparency for tables, views or program units of a remote
database.
--Simplify the SQL statements for database users

69 What is a SNAPSHOT ?
Snapshots are read-only copies of a master table located on a remote node which
is
periodically refreshed to reflect changes made to the master table.

70 What is Confine mode, and Flex Mode?


Confine Mode:
ON: REPEATING FRAME objects cannot be moved outside their enclosing FRAME
object.
OFF:REPEATING FRAME objects can be moved outside their enclosing
FRAME object.
Flex Mode:
ON: FRAME borders Extend when REPEATING FRAME objects are moved against them.
OFF: FRAME borders remain fixed when REPEATING FRAME objects are moved against
them.

71 Difference between DECODE and TRANSLATE


DECODE is value by value
character replacement. replacement.
Ex SELECT DECODE('ABC','A',1,'B',2,'ABC',3)
from dual; o/p 3
TRANSLATE
TRANSLATE is character by replacement
TRANSLATE('ABCGH','ABCDEFGHIJ', 1234567899)
FROM DUAL; o/p 12378 ('ABCGH','ABCDEFGHIJ', 1234567899)
FROM DUAL; o/p 12378
(DECODE command is used to bring IF,THEN,ELSE logic to SQL.It tests for the IF
values(s)
and then aplies THEN value(s) when true, the ELSE value(s) if not.)

72 What is an UTL_FILE.What are different procedures and functions associated


with it.
UTL_FILE is a package that adds the ability to read and write to operating syste
m
files
Procedures associated with it are FCLOSE, FCLOSE_ALL and 5 procedures to output
data to a file PUT, PUT_LINE, NEW_LINE, PUTF, FFLUSH.PUT,
FFLUSH.PUT_LINE,FFLUSH.NEW_LINE. Functions associated with it are FOPEN,
ISOPEN.

73 Srw package
FND SRWINIT: This User Exit is used to initialize the report in the memory.
FND SRWEXIT: This User Exit is used to release the memory occupied by the
program.
FND FLEXSQL: This User Exit is used to tailor the SELECT statement which returns
Call FND SRWINIT User Exit in Before Report Trigger.
BEGIN
SRW.USER_EXIT ( FND SRWINIT );
RETURN (TRUE);
END;
Call FND SRWEXIT User Exit in After Report trigger.
BEGIN
SRW.USER_EXIT ( FND SRWEXIT );
RETURN (TRUE);
END;
Call FND FLEXSQL User Exit in Before Report Trigger.
BEGIN
SRW.USER_EXIT ( FND SRWEXIT );
BEGIN
SRW.REFERENCE ( :P_STRUCT_NUM );
SRW.USER_EXIT ( FND FLEXSQL
APPL_SHORT_NAME = "SQLGL"
CODE = "GL#"
NUM = ":P_STRUCT_NUM"
OUTPUT = ":P_FLEXDATA"
MODE = "SELECT"
DISPLAY = "ALL" );
END;
RETURN (TRUE);
END;

74 What is the difference between Organization_id and Org_id ?


OrgId: Org Id is an unique ID for the Operating Unit.
Organization Id: The Organisation Id is an ID for the Inventory Organisation whi
ch
isunder an Operating Unit.

75 What is ERP? Architecture of apps?


A packaged business software system that lets a company automate and integrate t
he
majority
of its business processes; share common data and practices across the enterprise
;
[and] produce
and access information in a real-time environment.

76 How can u call a standard interface program from sql or pl/sql code?
FND_REQUEST.SUBMIT_REQUEST ( PO , EXECUTABLE NAME ,,,,PARAMETERS)

77 What are the User PARAMETERS in the Reports?


P_CONC_REQUEST_ID
P_FLEX_VALUE

78 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 lis
t
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 tab
le
based values
set.

79 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.

80 What r the type Models in the system parameters of the report?


1) Bit map 2) Character mode
81 What is a Concurrent Program ?
An instance of an execution file, along with parameter definitions and
incompatibilities. Several concurrent programs may use the same execution file t
o
perform their specific tasks, each having different parameter defaults and
incompatibilites.

82 What is a Concurrent Program Executable ?


An executable file that performs a specific task. The file may be a program
written in a standard language, a reporting tool or an operating system language
.
83 What is a Concurrent Request ?
request to run a concurrent program as a concurrent process.
84 What is a Concurrent Process ?
n instance of a running concurrent program that runs simultaneously with other
concurrent processes.

85 What is a Concurrent Manager ?


program that processes user s requests and runs concurrent programs. System
Administrators define concurrent managers to run different kinds of requests.
What is a Concurrent Queue ?
ist of concurrent requests awaiting processing by a concurrent manager.

86 What is a Concurrent Queue ?


Concurrent program that runs in a separate process than that of the concurrent
manager that starts it. L/SQL stored procedures run in the same process as the
concurrent manager; use them when spawned concurrent programs are not feasible.

87 What does set of books comprise of?


CHART OF ACCOUNTS, CALENDAR AND CURRENCY

88 What is a flexfield?
A flexfield is a flexible field which is used to capture mandatory or non
mandatory business information.

89 What is Flexfield structure?


A flexfield structure is collection of segments.

90 What is a Value set?


Value set is container of values that can be assigned to a segment of Flexfield
structure.

91 How many Flexfields are provided are by oracle applications?


30

92 What is the max no of segments that can be defined for the accounting flexfie
ld
structure?
30

93 What are the validation types supported by value sets?


None, Table, Independent, Dependent, Translatable independent, Translatable
Dependent, Special, Pair

94 What are the format types supported for a value set?


Number, Char, Standard date and time, standard time, time, date, date time

95 Is there any limitation on the no of flexfield structures that can be defined


for the Accounting Flexfield?
No

96 What are the flexfield qualifiers which are available for accounting flexfiel
d
structure?
Natural account, Cost center, Balancing, Intercompany

97 AOL Technical Reference Modules tables.


a. FND_CONCURRENT_PROGRAMS
B. FND_CONCURRENT_PROGRAMS_TL
C. FND_EXECUTABLE
D. FND_RESPONSIBILITIES (For Responsibilities Data)
E. FND_MENU (For Menu Data)

98 ALERTS
Oracle Alert will send messages or perform predefined
actions in an action set when important events occur
There are two types of Alerts
1. An event alert
2. A periodic alert
An event alerts: Event alerts immediately notifies the activity (i.e. an insert
or an
update to a table) in the database as it happens/ occurs.
A periodic alerts: Periodic alerts periodically report key information according
to
as
chedule you define.

99 what are the 2 mandatory parameters that we pass when we register a


conc program in oracle applications?
Ans:-
errbuf: This is out parameter which will through the error messages into the log
file.
retcode: This is also out parameter, it will tells the status of the concurrent
program.
if sucess it will give-------------- 0
if any warnings it will give--------1
if any error it will give ----------2

100 How do you kick a Concurrent program from PL/SQL?


Using FND_SUBMIT.SUBMIT_REQUEST.

101 How to display messages in Log file and Output file?


Using FND_FILE.PUT_LINE

102 How can u create a table in PL/SQL procedure?


By using execute immediate statement we can create a table in PLSQL.
BEGIN
EXECUTE IMMEDIATE 'create table giri as select * from emp';
END;
All DDL,DML,DCL commands can be performed by using this command.

103 How do we Tune the Queries?


Queries can be tuned by Checking the logic (table joins), by creating Indexes on
objects in the where clause,
by avoiding full table scans. Finally use the trace utility to generate the trac
e file, use the TK-Prof utility to
generate a statistical analysis about the query using which appropriate actions
can be taken

104 What the difference between UNION and UNIONALL?


Union will remove the duplicate rows from the result set while Union all does'nt
.

105 How to find out the database name from SQL*PLUS command prompt?
Select * from global_name;
This will give the datbase name which u r currently connected to.....
106 What is diffrence between Co-related sub query and nested sub query?
Correlated subquery runs once for each row selected by the outer query. It conta
ins a
reference to a value from the row selected by the outer query.
Nested subquery runs only once for the entire nesting (outer) query. It does not
contain any
reference to the outer query row.
For example,
Correlated Subquery:
select e1.empname, e1.basicsal, e1.deptno from emp e1 where e1.basicsal = (selec
t
max(basicsal) from emp e2 where e2.deptno = e1.deptno)
Nested Subquery:
select empname, basicsal, deptno from emp where (deptno, basicsal) in (select de
ptno,
max(basicsal) from emp group by deptno)

107WHAT OPERATOR PERFORMS PATTERN MATCHING?


Pattern matching operator is LIKE and it has to used with two attributes
1. % and
2. _ ( underscore )
% means matches zero or more characters and under score means mathing exactly on
e
character

108How can i hide a particular table name of our schema?


you can hide the table name by creating synonyms.
e.g) you can create a synonym y for table x
create synonym y for x;

109What is difference between DBMS and RDBMS?


The main difference of DBMS & RDBMS is
RDBMS have Normalization. Normalization means to refining the redundant and main
tain the
stablization.
the DBMS hasn't normalization concept.

to reverse the given string in oracle


--------------------------------------------
write a program to reverse a string in oracle of the given string

CREATE OR REPLACE PROCEDURE ReverseOf(input IN varchar2(50)) IS


reverse varchar2(50);
BEGIN
FOR i in reverse 1..length(input) LOOP
reverse := reverse||''||substr(input, i, 1);
END LOOP;
dbms_output.put_line(reverse);
END;

Das könnte Ihnen auch gefallen