SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 UDF Function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

satheesh
Posting Yak Master

United Kingdom
146 Posts

Posted - 07/19/2013 :  09:00:31  Show Profile  Reply with Quote
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

Sweden
30212 Posts

Posted - 07/19/2013 :  11:00:04  Show Profile  Visit SwePeso's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000