Question:
stored procedure - sql - asp?
anonymous
2010-10-14 23:34:53 UTC
Kindly give an example about the stored procedure
Three answers:
anonymous
2010-10-15 00:06:40 UTC
create strore procedure syntax and example:

syntax:

CREATE PROC [ EDURE ] [ owner. ] procedure_name [ ; number ]

[ { @parameter data_type }

[ VARYING ] [ = default ] [ OUTPUT ]

] [ ,...n ]



[ WITH

{ RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]



[ FOR REPLICATION ]



AS sql_statement [ ...n ]

Example:

CREATE PROCEDURE au_info_all

AS

SELECT au_lname, au_fname, title, pub_name

FROM authors a INNER JOIN titleauthor ta

ON a.au_id = ta.au_id INNER JOIN titles t

ON t.title_id = ta.title_id INNER JOIN publishers p

ON t.pub_id = p.pub_id

GO





execute store procedure:

EXECUTE au_info_all

-- Or

EXEC au_info_all
John S
2010-10-18 22:49:02 UTC
In Oracle



CREATE OR REPLACE PROCEDURE hello_world IS

BEGIN

FOR i in 1..100 LOOP

dbms_output.put_line('Hello World');

END LOOP;

END;



You can find some tutroials on stored procedures at http://www.asktheoracle.net/plsql-tutorial.html
petre
2016-12-14 08:22:36 UTC
For a unmarried question you may desire to deliver a team of information for the operation. in case you opt to do a chain of operations then there'll be loss of time in information shuttle. for that reason using technique will decrease the time loss. So the unmarried procedures will artwork greater effectual than the bunch of queries.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...