GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 13 of 166    Print  
What is the Scalar Data type in PL/SQL?
what is the forward decleration in packages?
what is the usage of IN,OUT,INOUT parameters in Procedures or functions?

  
Total Answers and Comments: 5 Last Update: January 16, 2007     Asked by: chiranjeevi reddy 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 12, 2006 10:48:58   #1  
richa        

RE: What is the Scalar Data type in PL/SQL?what ...

there are two types of data types available 1n pl/sql

1. scaler

2.composite

scaler datatypes are those which hold a single value and donot have any internal components they are clasified into 4 catagories

1.character 2.number 3.date boolean.Base scaler datatypes are char varchar2() long longraw number binary_integer boolean

Base scaler datatypes are date timestamp etc.

the parameters in out inout parameters used in pl/sql

in parameter is used to input data from the user out parameter is used to display the data or to retrieve information from the table..and through inout parameter you can pass values into a procedure and return a value.


 
Is this answer useful? Yes | No
February 17, 2006 13:49:16   #2  
Rachana        

RE: What is the Scalar Data type in PL/SQL?what ...
FWD declarations in pkg - the pkg has defination and a body for procedures and funcs. a fwd declaration is cosists simply of the program header followed semicolon. this header is declared in advance of the actual program defination and the program is available for use even before its defination.
 
Is this answer useful? Yes | No
October 17, 2006 03:28:17   #3  
raj        

RE: What is the Scalar Data type in PL/SQL?what ...

Hi

Scalar datatypes are the datatypes which hold a single value like char varchar number etc. whereas the composite datatypes are date timestamp etc. Hope this tip helps you...

bye..


 
Is this answer useful? Yes | No
December 27, 2006 10:28:11   #4  
Donald H. Kirschman        

RE: What is the Scalar Data type in PL/SQL?what ...

Scalar data types store one single element of data as opposed to composite data types. This is not a concept that is unique to Oracle PL/SQL; rather it is common to any programming language. Scalar types specific to Oracle include Integer Number Char Varhar2 Boolean etc.

In PL/SQL (and other languates like Pascal) a program unit such as a procedure or function must be defined before it can be invoked by another program unit. In PL/SQL package bodies forward declarations provide an optional means to get around this. You declare all program units before they actually appear in the package. A forward declaration is merely the name of the program unit and any parameters required. With forward declarations in place you are now free to arrange the program units in the package body in any order so as to improve readability or group program units together logically. Note that forward declaratiosn are not required so long as you code a program unit before it is called. Additionally forward declarations can appear anywhere not just at the top of the package body. Anytime you declare a program unit in advance of the actual coding that is a forward declaration.

IN OUT and INOUT refer to the mode of the parameter. This too is a general concept that is not unique to PL/SQL. IN defines a parameter as Input which means that the parameter is only used to provide a value to a program unit and nothing is returned. INOUT defines a parameter as Input/Output. This means that the parameter provides a value to the program unit and that the program unit may change the value of the parameter. OUT defines a parameter as Output only meaning that nothing is actually passed in to the parameter when calling the program unit but a value is retured. Output parameters are less useful and you would be hard pressed to find a situation where you need to use one.

Input parameters are also called value parameters or they are said to be passed by value. Input/Output parameters are also called variable address or reference parameters since they change values and the passing of the parameter is actually an address or memory location (a reference) to a place where the parameter is stored and can be changed by the called program unit.


 
Is this answer useful? Yes | No
January 16, 2007 08:00:30   #5  
       

RE: What is the Scalar Data type in PL/SQL?what ...
A forward declaration looks like the package definition part but is inside the bode.

e.g.

procedure A is
begin
B;
end A;

procedure B is
begin
null;
end B;

will not work because during call to B B is still unknown (1 Step compiler) therefore we need a forward declaration:

procedure B;

procedure A is
begin
B;
end A;

procedure B is
begin
null;
end B;


now we can compile

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape