GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Database  >  Stored Procedures
Go To First  |  Previous Question  |  Next Question 
 Stored Procedures  |  Question 11 of 12    Print  
Can you call procedure in functions

  
Total Answers and Comments: 1 Last Update: May 26, 2008     Asked by: chesy 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 26, 2008 23:06:13   #1  
krishnaindia2007 Member Since: September 2007   Contribution: 870    

RE: Can you call procedure in functions

Yes , we can. Here is simple example.

CREATE OR REPLACE PROCEDURE TEST_PROC(V_NUM OUT NUMBER) AS
BEGIN
V_NUM := 10;
END;
/


CREATE OR REPLACE FUNCTION TEST_FUNC RETURN NUMBER  AS
V_NUM NUMBER;
BEGIN
TEST_PROC(V_NUM);
RETURN V_NUM;
END;
/


SELECT TEST_FUNC() FROM DUAL;

OUTPUT
10


 
Is this answer useful? Yes | No

 Related Questions

A program running in the database that can take complex actions based on the inputs you send it. Using a stored procedure is faster than doing the same work on a client, because the program runs right 
Latest Answer : Stored procedures are pre compiled SQL Statements. Stored procedures can remove the compilation overhead that is typically required in situations where software applications send inline SQL queries to a database. Stored procedures allow for business ...

Latest Answer : 1. A function is used to compute a value. A porucedure is used to execute business logic.2. A functin must return a value. A procedure may not return a value or may return more than one value using out parameter.3. A function can be called from DML statements ...
Read Answers (16) | Asked by : vssandilya

What is the difference between "IS" and "AS" while creating procedure. Ex:- create procedure IS or AS?
Read Answers (5) | Asked by : Shekhar

Latest Answer : A function can be called in a select statement as well as in a stroed proc. As function call would return a value we need to store return value in a variable.Ex:Assume we have a fuction .. FN_TEST(Date IN VARCHAR2, ID OUR VARCHAR2) RETURN VARCHAR2.within ...
Read Answers (3) | Asked by : Sridhar Rao

Latest Answer : Stored procedures are stored in data base in complied form. In dynamic sql the statements are dynamically constructed at run time. ...
Read Answers (3) | Asked by : asd3

Why the stored functions can not be called from DML Statements? Why cant we modify the database by function?
Read Answers (3) | Asked by : Appu

Latest Answer : Yes , we can. Here is simple example. CREATE OR REPLACE PROCEDURE TEST_PROC(V_NUM OUT NUMBER) ASBEGINV_NUM := 10;END;/CREATE OR REPLACE FUNCTION TEST_FUNC RETURN NUMBER  ASV_NUM NUMBER;BEGINTEST_PROC(V_NUM);RETURN V_NUM;END;/SELECT TEST_FUNC() FROM ...
Read Answers (1) | Asked by : chesy

What is the difference between View and Stored Procedure? Can views accept input parameters as stored procedure? If yes,how could I do that? I am new to database and working on MS SQL,if someone could 
Latest Answer : View - A View in simple terms is a subset of a table. It can be used to retrieve data from the tables, Insert, Update or Delete from the tables. The Results of using View are not permanently  stored in the database. Stored Procedure -  A stored ...
Read Answers (4) | Asked by : preetiv


 Sponsored Links

 
Related Articles

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

Performing XSLT Transformations inside the Database

Performing XSLT Transformations inside the Database Now that you have the employees XSL stylesheet stored in the database and the xmlusr schema is permitted to access the hr employees table you can create a script that will instruct the database to build an HTML page based on the data stored in hr e
 

Moving All the XML Processing into the Database

Moving All the XML Processing into the Database In the preceding example the database server performs only a part of the XML processing while the rest is still performed by the PHP engine Specifically the database server generates an employees XML document based on the records from the hr employees
 

Performing XML Processing inside the Database

Performing XML Processing inside the Database When building XML enabled applications on top of Oracle there are many advantages to performing the XML processing inside the database when compared to performing it on the client The key advantages to perform XML processing inside the database are as fo
 

Microsoft AJAX Library - Anonymous Functions

Anonymous Functions Anonymous functions can be created adhoc and used instead of a named function Although this can hinder readability when the function is more complex you can do this if you don t intend to reuse a function s code In the following example we pass such an anonymous function to Displ
 

Microsoft AJAX Library - Functions as Variables

Functions as Variables In JavaScript functions are first class objects This means that a function is regarded as a data type whose values can be saved in local variables passed as parameters and so on For example when defining a function you can assign it to a variable and then call the function thr
 

Microsoft AJAX Library - JavaScript Functions

JavaScript Functions A simple fact that was highlighted in the previous chapter but that is often overlooked is key to understanding how objects in JavaScript work code that doesn t belong to a function is executed when it s read by the JavaScript interpreter while code that belongs to a function is
 

ERPAdvantages for Management Functions

ERP Advantages for Management Functions ERP management systems provide a technology platform in which organizations can integrate and coordinate their main internal business processes They use this to fight against the problem of the organizational inefficiency brought on by the use of different sys
 

C++ Static Functions

C Static Functions Static member functions have a class scope and they do not have access to the this pointer of the class When a member is declared as static a static member of class it has only one data for the entire class even though there are many objects created for the class The main usage of
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape