SQL Server String Funcs Supported by the Connectivity Kit

ID: Q103142

The information in this article applies to:

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 string functions that are supported.

MORE INFORMATION

The following table lists the supported string-manipulation functions.

IMPORTANT: Any character string passed as an argument to one of these functions MUST be enclosed in SINGLE quotation marks.

Parameter arguments listed as STRING_EXP can be character-type columns, strings, or character results from another function call.

Parameter arguments listed as START, LENGTH, CODE, or COUNT must be numeric values.

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

   ASCII(string_exp)                 Returns the ASCII code value of the
                                     leftmost character of STRING_EXP.

   CHAR(code)                        Returns the character that has the
                                     ASCII code Value specified by CODE.

   CONCAT(string_exp1,string_exp2)   Returns a character string that is
                                     the result of concatenating
                                     STRING_EXP1 with STRING_EXP2.

   INSERT(string_exp1,start,length   Returns a character string where
   string_exp2)                      LENGTH characters have been removed
                                     from STRING_EXP1 beginning at START
                                     and where STRING_EXP2 is then
                                     inserted in STRING_EXP1, starting
                                     at START.

   LCASE(string_exp)                 Converts all uppercase characters
                                     in STRING_EXP to lowercase.

   LEFT(string_exp,count)            Returns the leftmost COUNT
                                     characters of STRING_EXP.

   LTRIM(string_exp)                 Returns STRING_EXP with no leading
                                     blanks.

   LENGTH(string_exp)                Returns the number of characters in
                                     STRING_EXP, excluding trailing
                                     blanks and the string-terminator
                                     characters.

   LOCATE(string_exp1,               Returns the first starting position
   string_exp2 [,start])             of STRING_EXP1 within STRING_EXP2.
                                     If START is specified, the search
                                     begins at character START of
                                     STRING_EXP2.

   REPEAT(string_exp,count)          Returns a string consisting of
                                     STRING_EXP repeated COUNT times.

   REPLACE(string_exp1,string_exp2,  Replaces all occurrences of
   string_exp3)                      STRING_EXP2 in STRING_EXP1 with
                                     STRING_EXP3.

   RTRIM(string_exp)                 Returns STRING_EXP with no
                                     trailing blanks.

   SUBSTRING(string_exp,start,       Returns a substring of STRING_EXP
   length)                           starting at length position START
                                     that is LENGTH characters long.

   UCASE(string_exp)                 Converts all lowercase characters
                                     in STRING_EXP to uppercase.

REFERENCES

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

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

Last Reviewed: June 27, 1995