Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use TEMP table to select
Message
From
14/02/2005 11:46:56
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Use TEMP table to select
Miscellaneous
Thread ID:
00986675
Message ID:
00986675
Views:
52
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
Next
Reply
Map
View

Click here to load this message in the networking platform