_block
_local ve << gis_program_manager.cached_dataset(:electric)
_local a_file << external_text_input_stream.new("c:\deletar.map")
_loop
_local a_line << a_file.get_line()
_if a_line _is _unset _then _leave _endif
a_fields << a_line.split_by("|")
# if record is chain/line or point/location
_if a_fields[1].write_string = "3" _orif
a_fields[1].write_string = "1"
_then
table_name << a_fields[2].as_symbol()
id << a_fields[3].as_number()
a_record << ve.collections[table_name].at(id)
_if a_record _isnt _unset
_then
write("deletando registro ",a_record)
a_record.delete()
_else
write("registro ",table_name.write_string," id: ",id.write_string," nao encontrado!")
_endif
_endif
_endloop
ve.commit()
write("commited!")
_endblock
$
Nenhum comentário :
Postar um comentário