>lnResult = Sqlexec(m.hConn, "SELECT dbo.ReadValue(?m.paramValue) AS value2", "crsResult") >IF lnResult < 0 > * Error, use AERROR() > .... >ENDIF >m.value2 = crsResult.value2 >>
>> >>CREATE FUNCTION ReadValue >>( >> @Key char(10) >>) >>RETURNS decimal(16,3) >>AS >>BEGIN >> DECLARE @Value decimal(16,3); >> select @Value = field from table where key = @key; >> RETURN @Value; >>END >>GO >>>>
>>print readValue('1234567890'); >>>>
>>m.paramValue = "1234567890" >>m.hConn = GetSQLConnection() >>m.value2 = Sqlexec(m.hConn, "ReadValue(@Key = ?m.paramValue)") >>wait window m.value2 >>>>