Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sting Manipulation problem with SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00086804
Message ID:
00086813
Vues:
19
>>Shouldn't the select below return "5300" for the value?
>>
>>field1 = "CAMINO LOS REALES LOT#5300"
>>
>>select substr(field1,AT('#',field1)+ 1) from TABLE1 into cursor query
>>
>>All I am getting as a returned result is the first character of 5. I tried doing query below to force substr to return 10 characters after the number that the AT() function returns, but again all I get is the first character. I've tried several variations of this simple SQL but can't get it to return every thing to the right of the "#". If I use the command window and just use -> substr(field1,AT('#',field1)+ 1)
>>the returned value is correct, but for some reason SQL doesn't work with this construct. Any help greatly appreciated.
>>
>>Thanks,
>>
>>John
>
>Any time you use function as query result Foxpro will first allocate data type/width for this column and it does it based on the first record which will be retrieved, i.e. if fuction result for the first record is just one charater width then all next records will be cut off to the same 1 character.

Hi Ed,

The first record should be returning 6 characters. Field1 value for the first record is "CAMINO LOS REALES LOT#5300-A" so if I did my
SQL -> select substr(field1,AT('#',field1)+ 1) from TABLE1 into cursor query on this record only, shouldn't I have a value of 5300-A returned?

Thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform