Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use TEMP table to select
Message
De
14/02/2005 11:46:56
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Use TEMP table to select
Divers
Thread ID:
00986675
Message ID:
00986675
Vues:
53
Hi all,

I have a tempxxx table that contains hcode field as numeric for example 55555

but I would like to get the infos from SQL server tables hierachy and h_node

tempxxx table :( normal dbf or cursor )
hcode field

55555
66666
....


h_node table in SQL server :
hcode field

55555
66666
77777
88888
99999

hierarchy table in SQl server :
hcode field

55555
66666
77777
88888
11111
99999
00000
....
....
....

my results should get only the number 55555 & 66666 and denied the rest into
my temptodelete table after passing sqlexec command.

here is mycodes :
SELECT tempxxx

IF RECCOUNT() > 0               

   GO top
      
   DO WHILE !EOF()

      lcSelectSQL ="SELECT DISTINCT hier.account_code as account " + ;
         	"FROM h_node hnode, hierarchy hier " + ;
		"WHERE hier.hcode  = hnode.hcode  and hier.hcode = '" + tempxxx.hcode + "'"
					
	  lnExec = SQLEXEC(lnconnect,lcSelectSql,'temptodelete')		
      
      SKIP
     
   ENDDO
    
ENDIF

=sqldisconnect(lnconnect)

SELECT temptodelete
BROWSE
Any help in correcting my codes or new coding would be appreciated ?
TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform