Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL and Functions
Message
 
À
21/11/1997 18:25:24
Jon Griffin
Computer Nerds, Inc.
St. George, Utah, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00061695
Message ID:
00061700
Vues:
42
>I have a strange thing happening and can't find any good documentation on calling UDF's from a SQL statement.
>
>when I execute this SQL (Abridged) the functions are returning the correct string values, yet the cursor shows only the first instance of a letter.
>
>SELECT convertCType(c.cardtypes)AS ctypes, ;
> convertTtype(c.transtype) AS ttypes, ;
> cardtypes,transtype;
> FROM changes AS c
>
>
>FUNC convertTtype(ttype)
>*set step on
>ret = ""
>IF BITAND(1,ttype) # 0
> ret = ret + "S"
>ENDIF
>
>IF BITAND(2,ttype)# 0
> ret = ret + " Cr"
>ENDIF
>RETURN ret
>ENDF
>
>I always get either "S" in the column or if a 2 value it shows blank. I KNOW that the function returns the proper value. Also, how can I make an SQL column more than 6 characters long. It will cut off extra letters if I put for instance "A very large sale" as a return value. It seems that VFP is not as ANSI '92 compatible as MS would lead you to believe.

Ensure that your functions return the maximum expected string size each time. Use the space() function to pad them with blanks.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform