Salve a tutti,
è un po' che non mi faccio sentire per dei quesiti...be' è arrivato il
momento.
Ho un piccolo problema SQL che vado ad esporre.
Devo rinumerare una tabella contenete record (circa 700) quindi da 1 a
700, ma alcuni record sono IDENTICI.
la mia procedurina fa così :
'INIZIO PROC
dim nume as integer
nume = 0
rs=db.sQLSelect("select * from prezzi")
do until rs.eof
nume = nume + 1
rs1=db1.sQLSelect("select * from ARTICOLI where CODART = '" +
rs.field("CODICEART").value + "' order by CODART ")
if not rs1.eof then
db2.SQLExecute("update prezzi SET PROGR = '" + str(nume) + "',
DESCRART = '" + rs1.field("DESCRART").value + "' where CODICEART = '"
+ rs.field("CODICEART").value + "' and DATAART = '" +
rs.field("DATAART").value + "'" )
db2.commit
else
db2.SQLExecute("update prezzi SET PROGR = '" + str(nume) + "'
where CODICEART = '" + rs.field("CODICEART").value + "' and DATAART =
'" + rs.field("DATAART").value + "'" )
db2.commit
end if
rs.movenext
loop
msgbox "finito"
'FINE PROC
e ottengo la numerazione, MA I RECORD IDENTICI HANNO OVVIAMENTE
NUMERAZIONE UGUALE!
Probabilmente mi sto' perdendo in un bicchier d'acqua.....
Saluti a tutti e BUON NATALE!
Enrico
|