ODBC SQL Test thresholds

General chat about HostMonitor (all messages posted before March 07, 2003 available here).
Locked
Simon
Posts: 2
Joined: Wed Jan 15, 2003 6:00 pm

Post by Simon »

Hi,

I am using an ODBC SQL test that executes a query returning a single decimal value representing a percentage in the range 0.00 to 100.00. I then have enable the 'alert when field in 1,1 is > than 80' sub-test.

The problem seems to be that this test does not treat the value as a number but as text. i.e. I see the following results from this test:
10 good
20 good
70 good
81 bad
8.5 good!
9 bad!
9.5 bad!

Any ideas how I can perform a decimal threshold check rather than character check?

Thanks.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Probably you store this number in text field? HostMonitor compare fields according to the type:
- integer: SQL_INTEGER, SQL_BIGINT, SQL_SMALLINT, SQL_TINYINT, SQL_BIT, etc
- real: SQL_REAL, SQL_DOUBLE, SQL_FLOAT
- date: SQL_DATETIME, SQL_TYPE_DATE, SQL_TYPE_TIMESTAMP
- string: SQL_CHAR, SQL_VARCHAR, SQL_WCHAR, SQL_WVARCHAR
What type do you use?

Regards
Alex
Simon
Posts: 2
Joined: Wed Jan 15, 2003 6:00 pm

Post by Simon »

That is it. I returned a Decimal 10,2 value that is not supported from your list above. Once changed to type Real the test works.

Thanks for you support. Great Program!
Locked