What is stored procedure?

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 inside the database server. Stored procedures are nomally written in PL/SQL or Java.

Showing Answers 1 - 33 of 33 Answers

suresh

  • Aug 7th, 2005
 

How to Delete, modify,Add from Jsp using Database(Oracle) 
 
Thank U 
 

Madhu DS

  • Aug 19th, 2005
 

Sequence of SQL commands that are given a name and stored in the database already parsed, validated and optimized. At run time the program makes API call to execute the Stored Procedures rather than complex sequence of SQL commands

prabeshb

  • Sep 11th, 2005
 

A stored procedure is a group of SQL statements that form a logical unit and perform a particular task. Stored procedures are used to encapsulate a set of operations or queries to execute on a database server. For example, operations on an employee database (hire, fire, promote, lookup) could be coded as stored procedures executed by application code. Stored procedures can be compiled and executed with different parameters and results, and they may have any combination of input, output, and input/output parameters.

  Was this answer useful?  Yes

kautilya

  • Nov 7th, 2005
 

a set of sql statements which is stored in database in compiled form, which gives us fast execution which accepts i/p as well as o/p parameters it allows us modular programming

Stored Procs are a batch of SQL statements that are stored on a server.

Advantages:

1. Security - Code cannot be viewed by others who do not have the permission, SQL injection can also be reduced by prameterization of the stored proc inputs. 

2. Encapsulation - Put all related logic in one program. Users need to be worried only about the output.

3. Transaction management

4. Modular programming.

5. Performance - If the same proc is run often the query plan is loaded in the memory so execution is faster. But if the proc is not written carefully it will get recomplied even during execution depending on various factors.

SUBHANJAN BHATTACHARYYA

  • Dec 30th, 2005
 

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 inside the database server. Stored procedures are nomally written in PL/SQL or Java.

sithusithu

  • Jan 19th, 2006
 

A stored procedure is a precompiled collection of Transact-SQL statements and optional flow control statements, similar to an executable script. Stored procedures are stored and run within the database. You can run a stored procedure with the EXECUTE SQL statement in a database client tool, just as you can run SQL statements. Unlike standard SQL, however, stored procedures allow user-defined variables, conditional statements, and other powerful programming features.

Cheers,

Sithu

Phaneesh .B

  • Feb 8th, 2006
 

A procedure is a subprogram that performs a specific action.

             Stored Procedures are faster, because they eliminate the need to reparse and reoptimize the requests each time they're executed
  Pre-compile once, use Lesser time with more Performance
  Stored procedure is a re-usable object
  Reduce network traffic
  Separate business rules and logic from presentation layer

          Performance and ease of maintenance are two obvious reasons to use stored procedures.

         The most common reason to use a stored procedure is for database intensive processing that produces only small amounts of result data. This can save a large amount of communications across the network during the execution of the stored procedure.

          The use of stored procedures can be helpful in controlling access to data (restricting programs to data accessible only through the stored procedure), preserving data integrity (ensuring information is entered in a consistent manner), and improving productivity (statements in a stored procedure only need to be written one time).

          Isolation of code: Since all SQL is moved out of the external programs and into stored procedures, the application programs become nothing more than calls to stored procedures. As such, it becomes very simple to swap out one database and swap in another one

balaguru

  • Apr 18th, 2006
 

stored procudure is set of sql statement that you can assign one name store in database and that you compile form that you can share it between no of programs.

advantage

1.they can redure network traffic.

2.they allow modular programming.

3.they allow faster executio.

  Was this answer useful?  Yes

Sahitya Bindu

  • Sep 9th, 2006
 

Stored Procedures are a set of precompiled transact SQL statements that are stored under one name and executed as a single unit.

Precompiled:

Once the stored procedure is executed the execution plan is saved in the procedure cache and subsequent executions of the stored procedure will take the execution plan from the procedure cache which was saved for the first time thus minimizing time as the stored procedure is compiled and there is no need to recompile it .Until modifications or with recompile option in stored procedure is given all the subsequent executions will take the execution plan from the procedure cache.

  Was this answer useful?  Yes

Dharmendra Dixit

  • Oct 16th, 2006
 

Stored procedures are the sets of SQL statement which we r able to assign a name and stored in a particular location,and when we want to obtain the results so we r able to fire them..instead of that...

      Stored procedure has some benefit....so that's why we are using...
   1. it reduce network traffic.
   2. it can have multiple t-SQL statemet.
   3. you can execute SP inside SP.
   4. when you execute it save the execution plan in cache memory so
       that it will not compile everytime.
    5. it protect from hacker through SQL Injection.

  Was this answer useful?  Yes

Nodoubt The list of Answer is given for this question is absoultey correct But I would say Correct Answer never means a person understand the topic who put the question. I beleive Technically Defination always right & correct & more important I beleive how much you understand the topic?At time of learning (Still Learing) I used SP, but Always asked to myself why I am using SP. it's leanthy process of coding and check the SP through execution is time consuimg. One day I recevied a simple complex query, and that time I was looking the solution in method/procedure in front end tool. For instance problem is solved but the solution was for time being. Becuase the time is taken to process of rertieve record and modify record at client side and then save to server and meanwhile if some thing stuck in that process then may be half data will be updated or data will lost and many more hazard refelect to database. for keeping this issue I start to use SP, becuase it's already error free and ready to use. and one thing more if something goes wrong then SP will revert back the new data. and there is drawback and it return only intger value, by default. it has IN,INOUT and out parameters. Good Luck Everybody

  Was this answer useful?  Yes

Amol Bawane

  • Nov 15th, 2007
 

Stored procedure is the collection or we can say set  of Sql statements.It is used to performs various operations on database.By that it makes easy to access data.For various complex calculation,stored procedures make to perform database transaction.trasaction in the form od Insert,update,Delete.
It improves the performance of database.Stored proc is one of the object in database.

Thanks
Amol Bawane.

  Was this answer useful?  Yes

sampra

  • Mar 10th, 2008
 

stroded procedure is the set of plsql stmt which is used to execute query for which data that is already stored

  Was this answer useful?  Yes

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 logic to be embedded as an API in the database, which can simplify data management and reduce the need to encode the logic elsewhere in client programs. Carefully written stored procedures may allow for fine grained security permissions to be applied to a database.

  Was this answer useful?  Yes

guruprasad

  • Oct 3rd, 2012
 

Stored Procedure is a re-usable program which is created once and reused n times .
It stores the procedure at database level
It provides security, better performance.

  Was this answer useful?  Yes

Bhawna

  • Mar 3rd, 2016
 

Stored Procedure is group of SQL statements which is used to do a specific task. It is a pre-complied object which is complied for the first time and stored in server database so that it can be used again and again.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions