Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to count only new rows
Message
From
15/10/2004 14:07:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to count only new rows
Miscellaneous
Thread ID:
00951802
Message ID:
00951802
Views:
42
Hello,

currentTable.dbf with 4 records(rows)

empno field:

11111
22222
33333
44444


NewTable.dbf with 2 records(rows)

empno field:

22222
44444

NewTable never accepted duplicated empno numbers while inserting new values due to the
the data integrity checked inside.

I want to count 2 new records such 11111 and 33333 into lnRectot=2 not 4 because
22222 and 44444 already in Newtable.dbf

How can I get my lnRectot = 2 with below codes ?

Tia
lnconnect = SQLSTRINGCONNECT("dsn=sql server; uid=uid; pwd=pwd")

IF lnConnect > 0
  
   SELECT currentTable
   go top
 
   SCAN  
   
      lcstring = "INSERT INTO newTable (empno) Values (currentTable.empno)
     
      lnExec = sqlexec(lnconnect,lcstring)
         
      IF lnExec < 0
         && did not succeed
         =AERROR(laerror)
      ENDIF
 
   ENDSCAN
ELSE
	=AERROR(laerror)
	FOR N = 1 TO 7  && display all elements of the array
		? laerror(N)
	ENDFOR
	RETURN
ENDIF
=sqldisconnect(lnconnect)
Next
Reply
Map
View

Click here to load this message in the networking platform