monica1
24th September 2004, 11:42
I try to delete records of tables with dynamic sql but It doen`t delete anything. This is the code I'm using.
string sql.string(256)
domain tcmcs.long sql
sql.string = "select " & str$(mi.tabla)
& " from " & str$(mi.tabla) & " for update"
& " where " & clausula.where
sql = sql.parse(sql.string)
sql.where.bind(sql, 1, tfgld008.leac)
sql.exec(sql)
on case (sql.fetch(sql))
case 0:
db.delete(sql, db.retry)
case eendfile:
break
endcase
sql.break(sql)
sql.close(sql)
commit.transaction()
Where is my problem?
string sql.string(256)
domain tcmcs.long sql
sql.string = "select " & str$(mi.tabla)
& " from " & str$(mi.tabla) & " for update"
& " where " & clausula.where
sql = sql.parse(sql.string)
sql.where.bind(sql, 1, tfgld008.leac)
sql.exec(sql)
on case (sql.fetch(sql))
case 0:
db.delete(sql, db.retry)
case eendfile:
break
endcase
sql.break(sql)
sql.close(sql)
commit.transaction()
Where is my problem?