Affordable Access

Publisher Website

Chapter 14 - Using Procedure and Function Calls

Elsevier Inc.
DOI: 10.1016/b978-012374137-0.50015-8
  • Computer Science
  • Mathematics


Publisher Summary This chapter appraises the use of structured query language (SQL's) function library to good advantage to scrub and manipulate data. While computational languages (such as FORTRAN) and specialized statistical and mathematical languages have very rich function libraries, most SQL implementations are much poorer. SQL is a data management and retrieval language, and it was never meant for string handling, numerical computations, or application development. Programming languages make heavy use of nesting function calls and recursion. The obvious procedural code is a loop. It is quick and easy to write, but it keeps doing UPDATE statements that require table locking, logging, and a lot of overhead. When this was pointed out, the proposed solution was to do the work in different procedural code. This is the way that most procedural language programmers would do it. This algorithm still needs to be passed a key to locate which row it is working on. Function calls can be nested many levels deep in SQL products. This is faster than hanging in a loop, and it is pure SQL, which will log only one UPDATE statement and not use excessive row locking. This chapter also discusses parameters. A parameter is the formal name for a value passed to a procedure; an argument is the actual value that a parameter takes.

There are no comments yet on this publication. Be the first to share your thoughts.