Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combine 2 tables - better way?
Message
De
24/02/2004 14:23:40
 
 
À
24/02/2004 13:59:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00880102
Message ID:
00880419
Vues:
26
>you have a repro bug code ?

ja. i modi your code a bit. now, try this code 1 time without the '.dbf' behind all of the table names and one time with it.
OldDefa = set("defa")

CD SYS(2023)
MD dir1
MD dir2

close data all

CREATE TABLE dir1\table1 FREE (F1 I , F2 C(1))
INSERT INTO (ALIAS()) VALUES (1,'a')
INSERT INTO (ALIAS()) VALUES (2,'b')
USE

CREATE TABLE dir2\table1 FREE (F1 I , F2 C(1))
INSERT INTO (ALIAS()) VALUES (1,'A')
INSERT INTO (ALIAS()) VALUES (2,'B')
USE

set defa to (SYS(2023) + "\dir2")

SELECT ;
		tab1.f2 ;
	FROM ;
		(SYS(2023) + "\dir1\table1.dbf") tab1 ;
	WHERE ;
		tab1.F1=1 ;
	UNION all ;
		SELECT ;
				tab2.f2 ;
			FROM ;
				table1.dbf tab2 ;
			WHERE ;
				tab2.F1=1 .and. ;
				tab2.F2 not in (sele f2 from (SYS(2023) + "\dir1\table1.dbf") where F1=1) ;
	into cursor cur_test

sele cur_test
brow last

CLOSE TABLES ALL
set defa to (SYS(2023))
DELETE FILE dir1\table1.DBF
DELETE FILE dir2\table1.DBF
RMDIR dir1
RMDIR dir2
set defa to (OldDefa)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform