Reply to Re: Problem with nested function call (UDFs)

Your name:

Reply:


Posted by Gert-Jan Strik on 07/20/07 22:14

Hugo Kornelis wrote:
>
> On Fri, 20 Jul 2007 09:39:44 -0700, Carsten wrote:
>
> >Hello Folks,
> >
> >I encountered a problem with SQL server 2000 and UDFs.
> >
> >I have a scalar UDF and a table UDF where I would like the scalar UDF
> >to provide the argument for the table UDF like in:
> >
> >SELECT
> > *
> >FROM
> > transaction_t
> >WHERE
> > trxn_gu_id in (
> > select get_trxns_for_quarter(get_current_quarter( GetDate() ) )
> > )
> >
> >'get_current_quarter' returns an integer which is a GUID in a table
> >containing business quarter definitions, like start date, end date.
> >'get_current_quarter' is a scalar UDF.
> >'get_trxns_for_quarter' will then get all transctions that fall into
> >that quarter and return their GUID's in a table.
> >'get_trxns_for_quarter' is a table UDF.
>
> Hi Carsten,
>
> You need to select from a table-valued function. And you need to
> schema-qualify UDF's.

Hugo, you are right (as usual). The trick is in schemabinding the scalar
UDF (and addressing the UDF with its 2-part name).

Do you have any documentation or BOL reference that specifies that
schemabinding is required? Because I don't understand why this would be
relevant.

Thanks,
Gert-Jan

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация