Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PROBLEM: I want to use == on comparison of strings
Message
De
05/09/2003 14:06:18
 
 
À
05/09/2003 07:36:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00826335
Message ID:
00826559
Vues:
23
>Hi,
>
>Sorry, my title is not exact.
>Exact is:
>"PROBLEM: i want use == on comparison of strings"
>
>If i define on SQL Server a field F1 CHAR(2) and insert a string like 'A ',
>SQL Server not found 'A'.
>Example:
>
>CREATE TABLE #mytable (f1 char(2) )
>INSERT INTO #mytable VALUES ('A ')
>SELECT * FROM #mytable WHERE f1='A' && <-- return empty rowset
>DROP TABLE #mytable
>
>

Hi Fabio,

May be I misunderstood you, but the SELECT command on SQL Server does return 1 record.

Here is the code:
set ANSI_DEFAULTS ON

CREATE TABLE #mytable (f1 char(2) )
INSERT INTO #mytable VALUES ('A ')
SELECT * FROM #mytable WHERE f1='A'
DROP TABLE #mytable 
go

set ANSI_DEFAULTS OFF

CREATE TABLE #mytable (f1 char(2) )
INSERT INTO #mytable VALUES ('A ')
SELECT * FROM #mytable WHERE f1='A'
DROP TABLE #mytable
And here is the result:
(1 row(s) affected)

f1   
---- 
A 

(1 row(s) affected)


(1 row(s) affected)

f1   
---- 
A 

(1 row(s) affected)
Thanks,
Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform