realbasic-nug.it
[Top] [All Lists]

Probelmino SQL

To: "REALbasic NUG Italian" <realbasic-nug dot it at lists dot realsoftware dot com>
Subject: Probelmino SQL
From: <enricolr at libero dot it>
Date: Sun, 18 Dec 2005 19:36:26 +0100
Delivered-to: realbasic-nug dot it at lists dot realsoftware dot com
References: <7BCF718B-4729-4F8A-8F24-ABB7591CAB60 at tin dot it><005b01c600d4$b767ae90$6501a8c0 at sviluppo><5CED75CE-4690-4502-AC8B-872F2D8FCE43 at yahoo dot it><7348F7F5-F8C1-49E6-A53F-4F0552404624 at sqlabs dot net><a06230901bfc610d24b6e at [192 dot 168 dot 2 dot 2]><B6692D5B-6EE4-4222-ADE7-32FF9D6B5458 at yahoo dot it> <a06230900bfc720a52e52 at [192 dot 168 dot 2 dot 2]>
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




<Prev in Thread] Current Thread [Next in Thread>