Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function in SQL sort of kind of not working
Message
De
28/08/2008 15:44:30
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01342723
Message ID:
01342795
Vues:
20
Yes, I can just run two selects and it works in my testing, but why do I need to? It worked at first. Aren't we supposed to be able to use UDFs in SQL statements?

>That's another confirmaiton of the risk involved in using UDFs in Select-SQL. Can you add this field to your cursor after the select (e.g. post-process your cursor)?
>
>>This was working and now it does not. The problem is that the result value of PAYORID = "ZZCERT" (derived from cr.PayorID) but the value sent to the EligibilityRequestFormat function in the first parameter (cr.PayorID) is an empty string when it gets to the function. Well, it has about 10 spaces in it. How can the value of cr.PayorID be "ZZCERT" in the one field, but be empty in the other?
>>
>>If I remove the NPI field, the SQL returns the correct values, so the JOINs are working fine.
>>
>>
>>	SELECT ;
>>		ALLTRIM(cr.PayorID) AS PAYORID, ;
>>		ALLTRIM(cr.CarName) AS CARRNAME, ;
>>		'XX' AS NPI_Q, ;
>>		EligibilityRequestFormat(cr.PayorID, 'NPI', pt.PtSSN) AS NPI ;
>>		FROM patient pt ;
>>			JOIN ins_case ic ON ic.pat_no = pt.ptpn ;
>>			JOIN covr cv ON cv.Pat_No = pt.ptpn ;
>>				AND cv.cvps = 'P' ;
>>				AND dDateOfService BETWEEN EVL( cv.Eff_Date, {1/1/1950} ) AND EVL( cv.Exp_Date, DATE() ) ;
>>				JOIN inscarr cr ON cv.CvCarr = cr.inscarr ;
>>		WHERE pt.PtPn = cPatientNumber INTO CURSOR PD READWRITE
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform