> >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 >>
key = "1234567890" hConn = GetSQLConnection() value = '' && cast it Sqlexec(m.hConn, "select ?@m.Value = field from table where key = ?m.key") wait window m.value