SQL Server Numeric Funcs Supported by Connectivity Kit

Last reviewed: June 27, 1995
Article ID: Q103578
The information in this article applies to:
  • Microsoft FoxPro Connectivity Kit for Windows, version 2.5, 2.5a
  • Microsoft FoxPro Connectivity Kit for MS-DOS, version 2.5, 2.5a

SUMMARY

The Microsoft FoxPro Connectivity Kit can be used with FoxPro versions 2.5 and 2.5a for MS-DOS and Windows. The FoxPro Connectivity Kit, and the Open Database Connectivity (ODBC) specification in general, supports the minimum ANSI SQL standard. Below is a list of the SQL numeric functions that are supported.

MORE INFORMATION

The following table lists the supported numeric-manipulation functions.

Parameter arguments listed as NUMERIC_EXP or INTEGER_EXP can be numeric-type column names, numbers, or numeric results from another function call.

Parameter arguments listed as FLOAT_EXP can be numeric-type column names, numbers, or numeric results from another function call that contain decimal values.

   Function                   Description
   ---------------------------------------------------------------

   ABS(numeric_exp)           Returns the absolute value of
                              NUMERIC_EXP.

   ACOS(float_exp)            Returns the arccosine of FLOAT_EXP as
                              an angle expressed in radians.

   ASIN(float_exp)            Returns the arcsine of FLOAT_EXP as an
                              angle expressed in radians.

   ATAN(float_exp)            Returns the arctangent of FLOAT_EXP as
                              an angle expressed in radians.

   ATAN2(float_exp1,          Returns the arctangent of the x and y
   float_exp2)                represented by FLOAT_EXP1 and FLOAT_EXP2
                              as an angle expressed in radians.

   CEILING(numeric_exp)       Returns the smallest integer greater
                              than or equal to NUMERIC_EXP.

   COS(float_exp)             Returns the cosine of FLOAT_EXP, where
                              FLOAT_EXP is an angle expressed in
                              radians.

   COT(float_exp)             Returns the cotangent of FLOAT_EXP,
                              where FLOAT_EXP is an angle expressed
                              in radians.

   EXP(float_exp)             Returns the exponential value of
                              FLOAT_EXP.

   FLOOR(numeric_exp)         Returns the largest integer less than
                              or equal to NUMERIC_EXP.

   LOG(float_exp)             Returns the natural logarithm of
                              FLOAT_EXP.

   MOD(integer_exp1,          Returns the remainder of INTEGER_EXP1
   integer_exp2)              divided by INTEGER_EXP2.

   PI()                       Returns the value of PI as a floating-
                              point number.

   RAND([integer_exp])        Returns a random floating-point number
                              using the optional value of integer_exp
                              as a seed value.

   SIGN(numeric_exp)          Returns a 0, 1, or -1 depending on whether
                              NUMERIC_EXP is 0, positive, or negative,
                              respectively.

   SIN(float_exp)             Returns the sine of FLOAT_EXP, where
                              FLOAT_EXP is an angle expressed in
                              radians.

   SQRT(float_exp)            Returns the square root of FLOAT_EXP.

   TAN(float_exp)             Returns the tangent of FLOAT_EXP, where
                              FLOAT_EXP is an angle expressed in
                              radians.

Following is an example of how the SQRT() function could be used from within FoxPro to return the square root of the number 4 into the cursor named output. This example assumes that a valid connection to an ODBC data source has already been established and that the connection handle is contained in the variable mhand.

   result=DBEXEC(mhand, "SELECT {fn sqrt(4)}","output")

REFERENCES

Microsoft Open Database Connectivity Software Development Kit (SDK) "Programmer's Reference," version 1.0, pages 527-528


Additional reference words: FoxWin FoxDos CK 2.50 2.50a
KBCategory: kbtool kbinterop kbprg kbref
KBSubcategory: FxtoolCk


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.