Alaska Software Inc. - Re: Sentece DELETE with ODBC (SqlExpress or not but I work with SqlExpress).
Username: Password:
AuthorTopic: Re: Sentece DELETE with ODBC (SqlExpress or not but I work with SqlExpress).
Andreas Gehrs-Pahl

View the complete thread for this message in:

Re: Sentece DELETE with ODBC (SqlExpress or not but I work with SqlExpress).
on Sat, 04 Jun 2016 19:47:36 -0400
César,

>I need delete recordrs of a table and I get ir record by record.

If there aren't a lot of records, you could delete them all at once with 
this:

cSQL := "DELETE FROM VBSEGS1 WHERE DOC IN ("
while .not. oCur1:EoF()
   cSQL += "'" + oCur1:FieldGet("DOC") + "',"
   oCur1:Skip()
enddo

oStmt1:SQLString := left(cSQL, len(cSQL) - 1) + ");"
oStmt1:Execute()

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[F]:   https://www.facebook.com/AbsoluteSoftwareLLC