Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2010
    Posts
    2

    Unanswered: Can we have a TVF call inside a Scala function ?

    I am using the following query

    select 'level' =

    case when dbo.function1 = 1 then

    ( case when ( dbo.function2(dbo.function3, 1) > 0) then 3

    end )

    end

    it is showing error "Cannot find either column "dbo" or the user-defined function or aggregate dbo.function3 "

    dbo.function3 is TVF.

    so i tried with this

    select 'level' =

    case when dbo.function1 = 1 then

    ( case when ( dbo.function2((select * from dbo.function3), 1) > 0) then 3

    end )

    end

    then i have

    "Only one expression can be specified in the select list when the subquery is not introduced with EXISTS."

    ONLY function3 is TVF all others are scalar.

    Let me know whats the right way to code this.

  2. #2
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Can you give the definition of the dbo.function2 function? Is its first parameter a table, because that is what you are passing it.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  3. #3
    Join Date
    Jul 2010
    Posts
    2
    yes..!! its first param is a table which is generated by function3.
    I have couple of functions like function2 which takes the function3 return value.
    Is it like i can pass the table column by column instead of multiple columns? In that case can i pass the multiple rows into the function ?

  4. #4
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Can you show the code?
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •