Function of a Function

  • I have a function that returns a string of order numbers delimited with ';'  

    SELECT dbo.getSOs(121616) returns string of orders for the input customer 121616

    "123;345;456;678;"

    I am trying to using the Split function from

    http://qa.sqlservercentral.com/scripts/contributions/225.asp

    to return a table of ints. Both functions independly work fine

    SELECT * FROM dbo.SplitToInt("123;345;456;678;",";") return a table of ints.

    When I run this query (for Customer 121616) 

    SELECT * FROM dbo.SplitToInt(dbo.getSOs(121616),';')

    I get an error "Incorrect syntax near '.'"

    What am I doing wrong ?

     

  • You cannot use function call as a parameter for anither function. It's wrong syntax.

    DECLARE @String varchar(100)

    SELECT @String =dbo.getSOs(121616)

    SELECT * FROM dbo.SplitToInt(@String,';')

    _____________
    Code for TallyGenerator

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply