PL/SQL is a block-structured language, meaning that programs can be divided into logical blocks. Program units can be named or unnamed blocks. Unnamed blocks are known as anonymous blocks. The PL/SQL coding style differs from that of the C, C++, and Java programming languages. For example, curly braces do not delimit blocks in PL/SQL.
A PL/SQL block consists of up to three sections: declarative (optional), executable (required), and exception handling (optional).
Note: In PL/SQL, an error is called an exception.


Executing Statements

DECLARE v_variable VARCHAR2(5);
BEGIN
SELECT column_name INTO v_variable FROM table_name;
EXCEPTION
WHEN exception_name THEN

END;

  • Place a semicolon (;) at the end of a SQL statement or PL/SQL control statement.
  • Section keywords DECLARE, BEGIN, and EXCEPTION are not followed by semicolons. END and all other PL/SQL statements require a semicolon to terminate the statement.

Block Types
A PL/SQL program comprises one or more blocks. These blocks can be entirely separate or nested one within another. The basic units (procedures and functions, also known as subprograms, and anonymous blocks) that make up a PL/SQL program are logical blocks, which can contain any number of nested subblocks. Therefore, one block can represent a small part of another block, which in turn can be part of the whole unit of code.

PL/SQL stands for Procedural Language extension of SQL.
PL/SQL is a combination of SQL along with the procedural features of programming languages. It was developed by Oracle Corporation in the early 90’s to enhance the capabilities of SQL.
PL/SQL Environment
PL/SQL is not an Oracle product in its own right; it is a technology used by the Oracle server and by certain Oracle tools. Blocks of PL/SQL are passed to and processed by a PL/SQL engine, which may reside within the tool or within the Oracle server. The engine that is used depends on where the PL/SQL block is being invoked from. When you submit PL/SQL blocks from a Oracle precompiler such as Pro*C or Pro*Cobol program, userexit, iSQL*Plus, or Server Manager, the PL/SQL engine in the Oracle Server processes them. It separates the SQL statements and sends them individually to the SQL statements executor.

A single transfer is required to send the block from the application to the Oracle Server, thus improving performance, especially in a client-server network. PL/SQL code can also be stored in the Oracle Server as subprograms that can be referenced by any number of applications connected to the database.
Many Oracle tools, including Oracle Developer, have their own PL/SQL engine, which is independent of the engine present in the Oracle Server. The engine filters out SQL statements and sends them individually to the SQL statement executor in the Oracle server. It processes the remaining procedural statements in the procedural statement executor, which is in the PL/SQL engine. The procedural statement executor processes data that is local to the application (that is, data already
inside the client environment, rather than in the database). This reduces the work that is sent to the Oracle server and the number of memory cursors that are required.
Advantages of PL/SQL
These are the advantages of PL/SQL.
Block Structures: PL SQL consists of blocks of code, which can be nested within each other. Each block forms a unit of a task or a logical module. PL/SQL Blocks can be stored in the database and reused.
Procedural Language Capability: PL SQL consists of procedural language constructs such as conditional statements (if else statements) and loops like (FOR loops).
Better Performance: PL SQL engine processes multiple SQL statements simultaneously as a single block, thereby reducing network traffic.
Error Handling: PL/SQL handles errors or exceptions effectively during the execution of a PL/SQL program. Once an exception is caught, specific actions can be taken depending upon the type of the exception or it can be displayed to the user with a message.
Architecture
The PL/SQL language is a robust tool with many options. PL/SQL lets you write code once and deploy it in the database nearest the data. PL/SQL can simplify application development, optimize execution, and improve resource utilization in the database.
The language is a case-insensitive programming language, like SQL. This has led to numerous formatting best practice directions. Rather than repeat those arguments for one style or another, it seems best to recommend you find a style consistent with your organization’s standards and consistently apply it. The PL/SQL code in this book uses uppercase for command words and lowercase for variables, column names, and stored program calls
PL/SQL also supports building SQL statements at run time. Run-time SQL statements are dynamic SQL. You can use two approaches for dynamic SQL: one is Native Dynamic SQL (NDS) and the other is the DBMS_SQL package. The Oracle 11g Database delivers new NDS features and improves execution speed. With this release, you only need to use the DBMS_SQL package when you don’t know the number of columns that your dynamic SQL call requires. Chapter 11 demonstrates dynamic SQL and covers both NDS and the DBMS_SQL package.

Q) What is Planning Budget?

A) The plan for the future expenses is planning budget. It is a paper work. There is no funds requirement. It does not require journals. There are no restrictions for estimating of funds. It is a budget through which you cannot excercise budgetary control . But you can compare your actual budgets through inquiry window.

Q) After creating Journal Source how do we approve to the specific set of Books?

A) To approve journals from specific source, while creating the source ‘Require Journal Approval’
check box should be enabled. To approve all the journals that come from different sources In the Set of Books window under ‘Journaling’ tab ‘journal approval’ should be enabled.

Q:  What formula should I use to balance AP to GL? 
A:  Use the following as an example of how to balance. In this example, you are closing your accounting period for April and you have just posted your final invoice and payment batches to your general ledger system.

To reconcile your accounts payable activity for April, make the following calculation:“Accounts Payable Trial Balance” as of March 31+   “Posted Invoice Register” for the period between April 1 and April 30–    “Posted Payment Register” for the period between April 1 and April 30

=   “Accounts Payable Trial Balance” as of April 30 
Reconciling AP to GL is accomplished with the use of the following reports.
“Posted Invoice Register”
“Posted Payment Register”
“Accounts Payable Trial Balance” (current and last period)
These reports ensure that your Trial Balance accurately reflects your accounts payable liability by matching the Posted invoices and payments with the AP liability account. You can also compare your AP liability accounts to GL by doing a query of the accounts in GL to identify the account or accounts out of balance. The trial balance total should be the same as your GL liability account.
If not:

Run the GL “Account Analysis” report for the liability account and for the date range in question. Look for transactions with a source other than Payables. This can quickly pinpoint any transactions incorrectly charged to the account. Make sure that you have not made manual journal entries to your liability account in General Ledger.When you identify the accounts you go back to AP and do a query on the account to find the invoices out of balance.

The last step is to create a journal entry in GL to balance the account or accounts that is out of balance.

Q: How is the as-of-date used in the “Accounts Payable Trial Balance” report? 

A: The as-of-date is used to determine which invoices and payments should be included on the report.  Any invoices or payments with an accounting date AFTER the entered as-of-date will not be displayed on this report. 

1. What are the different ways of adding assets in FA?
2. How do we depreciate Assets in Oracle Applications?
3. What is the significance of asset books in FA? Types?
4.What is ment by retire asset? How do we retire assets in Oracle applications?
5. What are the various Journal Entries generated through fixed assets
6.At what level FA is implemented?
7.What is the profile used to secure asset register?
8.What are the asset types in FA Module?
9.What are the different calendars used in FA Module?
10.Is FA Supports Multi _org?

11.What is ment by Roll back depreciation?
12.What are the mandatory flexfiels used in FA?
13.What are the depreciation methods used in FA module?
14.What is ment by prorate convention?
15.What is the use of allow amortized changes check box?
16.What is the difference between Quick addition and detail addition?
17.What is ment by projection?
18.What is ment by what-if analysis?
19.What is ment by leased asset?
20.What is ment by depreciation override? Can we override depreciation?
21.What is ment by physical inventory reconciliation?
22.Tell me something about asset insurance?
23.What is ment by asset revaluation?
24.In prepare mass additions window what are available Q names?
25.what is the difference between initial mass copy and periodic mass copy?
26.what is internal retairment?
27.What experience do you have in FA Module Implementation?
28.What do you know about FA to GL cycle?