Stored procedure with "union" not populating secondary data source. - InfoPath Dev
in

InfoPath Dev

Stored procedure with "union" not populating secondary data source.

Last post 12-03-2008 05:45 AM by swathip. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-02-2008 11:36 PM

    • Greg S
    • Not Ranked
    • Joined on 10-16-2006
    • Posts 9

    Stored procedure with "union" not populating secondary data source.

    Why doesn't InfoPath load data from a stored procedure that uses a UNION query?

     Ex: if the stored procedure is:

    select myColumn from table1

    the data source populates just fine.  But if the stored procedure is:

    select myColumn from table1
    union
    select
    myColumn from table1

    the data source is not populated.  And yes, that Union query is returning the same exact data.  I actually stumbled upon it because I was trying to do this:

    select myColumn from table1
    union
    select
    'someValue' as myColumn

    I'm primarily a SQL and .Net developer, so I'm perplexed as to what InfoPath is doing.

    Any enlightenment is greatly appreciated!

  • 12-03-2008 05:45 AM In reply to

    Re: Stored procedure with "union" not populating secondary data source.

    Hi,

    I have verified the following query and it is working fine.

    select myColumn from table1
    union
    select myColumn from table1

    Coming to

    select myColumn from table1
    union
    select 'someValue' as myColumn

    instead of above one use the following query .

    select CONVERT(NVARCHAR, myColumn)as myColumn from table1

    union select 'someValue' as myColumn

     

    ex: select CONVERT(NVARCHAR,ID )as ID from dbo.EmpDetails

    union select 'id' as ID

     

    Swathip
    www.ggktech.com
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.