DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: Functions

  1. #1
    s Guest

    Functions


    What user created function would I use
    inline,
    scalar,
    or table,

    to perform this

    Select
    --This would be the function.
    BuildDisplayName tbl.FirstName, tbl.LastName as [DispalyName],
    --
    Address1,
    Address2,
    City,
    State,
    etc
    from tableA as tbl
    where tbl.ID = 5


  2. #2
    David Satz Guest

    Re: Functions

    scalar:


    CREATE FUNCTION dbo.ufn_BuildDisplayName(
    --The last name, first name and middle initial
    @LastName varchar(75)
    , @FirstName varchar(75)
    , @MiddleInitial char(1) = NULL
    )
    --This function returns the email address according to Hyperion standards
    RETURNS varchar(200)
    AS
    BEGIN
    DECLARE @DisplayName varchar(200)

    SET @DisplayName =
    you logic here

    RETURN @DisplayName
    END
    GO

    then the call w/b

    Select
    dbo.ufn_BuildDisplayName( tbl.FirstName, tbl.LastName ) as [DispalyName],
    Address1,
    Address2,
    City,
    State,
    etc
    from tableA as tbl
    where tbl.ID = 5

    --
    HTH,
    David Satz
    Principal Web Engineer
    Hyperion Solutions

    "s" <srr@gksys.com> wrote in message news:3edb7177$1@tnews.web.devx.com...
    >
    > What user created function would I use
    > inline,
    > scalar,
    > or table,
    >
    > to perform this
    >
    > Select
    > --This would be the function.
    > BuildDisplayName tbl.FirstName, tbl.LastName as [DispalyName],
    > --
    > Address1,
    > Address2,
    > City,
    > State,
    > etc
    > from tableA as tbl
    > where tbl.ID = 5
    >




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links