Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use TEMP table to select
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00986675
Message ID:
00987976
Views:
37
I am not sure if I understand your issue entirely but it looks like you are trying to accumulate rows into temptodelete which you want to delete at the end. SQLEXEC creates new temptodelete cursor everytime in the WHILE loop. So you will end up with last resultset of the last row of tempxxx table.

Makes sense?

>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
- Jayesh
Previous
Reply
Map
View

Click here to load this message in the networking platform