Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The number in Replicate creates a problem
Message
De
05/04/2022 04:45:20
Lutz Scheffler (En ligne)
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01684050
Message ID:
01684058
Vues:
49
Hi Dimitry,

Without looking to deep.
Try:
*no error
SELECT REPLICATE(' ',1) from cTable
*no error
SELECT REPLICATE(' ',0) from cTable
*error 1903
SELECT REPLICATE(' ',-1) from cTable
<pre>

I guess you have a problem in your maths

pro tip: error occurs without select too

Lutz

>Hi,
>
>I am troubleshooting the following issue.  And I can't figure out what causes it.
>
>A somewhat long SQL Select has the following segment:
><pre>
>REPLICATE('&nbsp;',10-LEN(ALLTRIM(REFERENCE)))
>
>
>The purpose of the above is to create a string of entity codes (nbsp) equal to the number of spaces after some entry in a field. The field name is REFERENCE. It used to be up to 10 characters in length. And the user was able to enter only up to 10 characters. And the above code worked.
>Then I increased the length of the field to 15. But the entry in the field is still the same, less or equal to 10 characters.
>Now the above code does not work. The SQL Select returns the error:
>
>String is too long to fit.
>
>
>If I change the 10 in the above REPLICATE with 15, no error.
>
>REPLICATE('&nbsp;',15-LEN(ALLTRIM(REFERENCE)))
>
>
>I don't understand why? Since the entry in the REFERENCE field is still only up 10 characters, the code 10-LEN... should work. Unless I miss something obvious.
>
>TIA for any explanation
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform