Joining database table with Linked Server for DB2 results...

  • Hi All
    i have  to work on getting some results from linked server stored procedure...

    I have to use results of a SP in mc400(db2) in SQL query to produce results.

    problem is that the SP in mc400 takes only 1 parameter and return results for that person.

    I need to run that stored proc for each person separately,  to see that person's results.( i want to do this using a join by joining to person table on PersonID)

    I am able to bring the results in a temp table in SQL side but still how can I join to that SP in mc400 with my person table to get all person's email at that same time. 

    CREATE TABLE #TempTable (

    personnumber VARCHAR(200), email VARCHAR(200)
    )

    insert into #TempTable
    (
    personnumber, email
    )
    EXEC ('CALL GetPersonEmail(?)','12345') At Mylinkedserver --person no. 12345

    SELECT personnumber, email from #TempTable

    any help or suggestion on this..

    thanks

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

Viewing 0 posts

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