Microsoft KB Archive/103578: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 86: Line 86:
</pre>
</pre>
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.
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.
<pre>  result=DBEXEC(mhand, &quot;SELECT {fn sqrt(4)}&quot;,&quot;output&quot;)
<pre>  result=DBEXEC(mhand, "SELECT {fn sqrt(4)}","output")
</pre>
</pre>
== REFERENCES ==
== REFERENCES ==


Microsoft Open Database Connectivity Software Development Kit (SDK) &quot;Programmer's Reference,&quot; version 1.0, pages 527-528
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
Additional reference words: FoxWin FoxDos CK 2.50 2.50a KBCategory: kbtool kbinterop kbprg kbref KBSubcategory: FxtoolCk

Latest revision as of 09:28, 20 July 2020

SQL Server Numeric Funcs Supported by Connectivity Kit

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


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