Re: What is a stored procedure?
Posted in 1998
In article <363730a1.1236249084@news.globalnet.co.uk>, cindewey@hotmail.com wrote: > A lot of queries seem to crop up about stored procedures but I have no > idea what they are. > Can someone please provide a brief explantion as to what it is and how > useful they are? Also, how do you implement them and how should you > decide when to write one? A stored procedure or User Defined Routine (according to the manual): >>What Is a User-Defined Routine? >>A user-defined routine (UDR) is a routine that you create and register in the >>system catalog tables and that you invoke within an SQL statement or >>another routine. >> >>A UDR can be either a function or a procedure. A function is a routine that >>optionally accepts a set of arguments and returns a set of values. A function >>can be used in SQL expressions. A procedure is a routine that optionally >>accepts a set of arguments and does not return any values. A procedure >>cannot be used in SQL expressions because it does not return a value. >>The database server provides the following kinds of routines: >>-Informix Stored Procedure Language (SPL) routines >> The body of an SPL routine contains SQL statements and flow control >> statements for looping and branching. SPL provides the flow control >> extensions to SQL. >> >> Because routines written in SQL are parsed, optimized as far as >> possible, and then stored in the system catalog tables in executable >> format, consider using an SPL routine for SQL-intensive tasks. For >> more information on how to write an SPL routine, refer to the >> Informix Guide to SQL: Tutorial. >> >>-External routines >> The body of an external routine contains statements from a >> supported language (for example, C language) other than SPL. >> >> External routines typically perform operations on user-defined data >> types. For more information on how to write an external routine, >> refer to the Informix DataBlade API Programmer's Manual. >> >>SPL routines can execute routines written in C or other external languages, >>and external routines can execute SPL routines. Tony -- asalerno@monmouth.com -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own