Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Big Bug with Integer Field
Message
 
To
27/12/2000 13:38:11
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00457047
Message ID:
00457095
Views:
27
>Hi, everybody!
>
>I need your help... I'm with a problem that is ocurring also with some other friends (and with some other, not)...
>
>Do as follows:
>
>* Create a table called Test1 with the structure:
>Field: iID
>Type: Integer
>
>* Create a table called Test2 with the structure:
>Field: iID
>Type: Integer
>
>* Create any FOR/NEXT to fill these tables with some 1000 records
>For example:
>SELE TEST1
>FOR i=1 TO 1000
> appen blank
> repl all iID with recno()
>ENDFOR
>
>Do this in both tables.
>
>Well, these two table has the same structure and the same content (records and value)
>
>Now, run the following command:
>
>SELECT * FROM TEST1 WHERE IID NOT IN (SELECT IID FROM TEST2)
>
>We're trying to descover which records is in the Test1 and don't have a corresponding record in Test2. It must return Zero records, because they're exact the same. However, here comes the problem: in my SQL, returns a cursor with the folling records: 17, 253, 509 and 765. Do you see? It begun with 17, and goes adding 256... 17+256=253... 253+256=509.. etecera...
>
>After did a lot of attempts, I resolved to change the type of field IID of table Test2, to Numeric 4,0... well, it does work... I'm sure that it's a problem with Integer Fields.
>
>Could anybody explain this for me?
>
>Thanks in Advance
>
>[]'s
>
>Lassala




Claudio try with:
FOR i=1 TO 1000
  APPEND BLANK IN Test1
  APPEND BLANK IN Test2
ENDFOR
REPLACE ALL iID WITH RECNO IN Test1
REPLACE ALL iID WITH RECNO IN Test2
SELECT * FORM Test1 WHERE iID NOT IN (SELECT iID FROM Test2)
You must remove from the loop the sentence REPLACE ALL
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de www.PortalFox.com
Nada corre como un zorro
________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform