Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Custom Functions
Sat, Sep 2 2006 11:09 AMPermanent Link

"Robert Eastlack"
If I define a custom SQL function: FormatMyString(StringToFormat, Format)

Then call it in this SQL:

SELECT * FROM MyTable
WHERE MyField = FormatMyString('Testing', 'X')

Will it execute FormatMyString just once, at the beginning of the query, or
will it do it for every record in the table?  Obviously if it is executing
for every record that will be dramatically slower, especially if MyField is
indexed.

Thanks,

Robert.
Sun, Sep 3 2006 4:18 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Robert


Every row in the table.

Roy Lambert
Mon, Sep 4 2006 12:42 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Robert,

<< Will it execute FormatMyString just once, at the beginning of the query,
or will it do it for every record in the table?  Obviously if it is
executing for every record that will be dramatically slower, especially if
MyField is indexed. >>

As long as you only pass it constant values, then it will only execute it
once.  If you pass it a column, then DBISAM will be forced to execute it
once for every record in the table.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Sep 5 2006 11:38 AMPermanent Link

"Robert Eastlack"
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:8ED1AF3D-185F-4410-A809-234F532056D6@news.elevatesoft.com...
> Robert,
>
> << Will it execute FormatMyString just once, at the beginning of the
> query, or will it do it for every record in the table?  Obviously if it is
> executing for every record that will be dramatically slower, especially if
> MyField is indexed. >>
>
> As long as you only pass it constant values, then it will only execute it
> once.  If you pass it a column, then DBISAM will be forced to execute it
> once for every record in the table.

Thank you Tim, that's exactly what I was hoping you would say.
Image