Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 UDF Function

Author  Topic 

satheesh
Posting Yak Master

152 Posts

Posted - 2013-07-19 : 09:00:31
Hi All,

I try to pass a parameter to a function 'dbo.[getConditions]'

select [dbo].[getConditions] ('GALTACS55785') as MedicalCondition, I got the below result

MedicalCondition
No heart related procedures declared/ Cholesterol


However i try to pass a value from a table like below

SELECT MSpolicy.ScreeningID , dbo.[getConditions](MSPolicy.ScreeningID ) as MedicalCondition
FROM MSPolicy


I got the below error

Msg 9400, Level 16, State 1, Line 2
XML parsing: line 1, character 8000, unexpected end of input

How to pass a value from a table to UDF function.

[MSPolicy table has field 'ScreeningID' eg ('GALTACS55785'),i need to pass this Screeningid to the function to get the corresponding condition for all the ID's]

Expected output
ScreeningID MedicalCondition
GALTACS55785 No heart related procedures declared/ Cholesterol
FGTTAC567983 Asthma/Sugar

Any help will be highly appreciated

Thanks

Regards,
SG

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2013-07-19 : 11:00:04
You are most probably not handling the XML input correctly. It seems you are parsing the data as string.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -