Talk:User-defined function: Difference between revisions

Content deleted Content added
{{WikiProject Computing|class=|importance=}}
PrimeBOT (talk | contribs)
m Replace magic links with templates per local RfC - BRFA
Line 57:
::The point the article is trying to make is that a function is invoked within a statement once per row within the statement. A stored procedure can't be evaluated once per row within a statement -- unless you wrap it in another function. (Note that the body of a triger, declared FOR EACH ROW or not, is semantically equivalent to a function.) If you can find a more accurate way to express that, let us know! -- [[User:Mikeblas|Mikeblas]] 20:24, 28 July 2006 (UTC)
 
:::Hey, I found it -- I forgot that ANSI SQL uses "CALL". The way Melton and Simon explain it (in {{ISBN |1-55860-456-1}}) is that ''procedures are involved exclusive by means of a specific SQL statment: the CALL statement; by contrast, SQL-invoked functions are treated as "values" in an expression of some sort and are invoked exclusively as a means of evaluating that value.'' You can't use CALL for per-row evaluation within DQL. -- [[User:Mikeblas|Mikeblas]] 20:32, 28 July 2006 (UTC)
 
::::Actually, SQL:2003 (the current version of the SQL standard) supports UDFs and stored procedures. It does that since SQL3. See subclause 11.50, "<SQL-invoked routine>". I understand your point regarding "once per row". But I think it is not correctly expressed. Besides, there are table functions (also in the standard) and those have a slightly different behavior when invoked. (I'll try to incorporate my thoughts later on.) -- [[User:stolze|stolze]] 08:30, 31 July 2006 (UTC)