Board index » delphi » User defined functions in SQL???

User defined functions in SQL???

Is there a way to create and use "user defined functions" in local SQL,
like developers can do in FoxPro/VFP?  For instance, I have to find the
last date out of nine possible dates in some searches.  I'd like to know
if there's a way I can do something like

select last, first, middle, number, LASTDATE (as the user-defined
function) from <tablename> where LASTDATE > DATE order by last, first,
middle

Any ideas???

I'm using dBase tables via the BDE 5.01.

Thanks, in advance!
Robert Davis
webmas...@pmrinc.com

 

Re:User defined functions in SQL???


UDF's are not supported by Local SQL.

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Re:User defined functions in SQL???


On Mon, 22 Nov 1999 12:45:58 -0600, Robert Davis <webmas...@pmrinc.com>
wrote:

Quote
>Is there a way to create and use "user defined functions" in local SQL,
>like developers can do in FoxPro/VFP?  For instance, I have to find the
>last date out of nine possible dates in some searches.  I'd like to know
>if there's a way I can do something like

>select last, first, middle, number, LASTDATE (as the user-defined
>function) from <tablename> where LASTDATE > DATE order by last, first,
>middle

How about something like this (using just SQL):

  SELECT last, first, middle, number, DateCol
  FROM TableName
  WHERE DateCol =
    (SELECT MAX(DateCol)
    FROM TableName)

==========================================================================
Steve Koterski                  "Computers are useless. They can only give
Technical Publications          you answers."
Borland                                       -- Pablo Picasso (1881-1973)
http://www.borland.com/techpubs/delphi

Other Threads