Salve amici, come faccio ad inserire uno stesso valere in più tabelle? Ciooè, devo fare più insert o esiste il modo di farne uno unico???
Salve amici, come faccio ad inserire uno stesso valere in più tabelle? Ciooè, devo fare più insert o esiste il modo di farne uno unico???
Digital XP - The new expression of digital art! - http://www.mimanchitu.it
Fai tante insert.
scusa cioè devo fare:
Non posso fare un'unica INSERT visto che il valore da inserire è sempre lo stesso?codice:SQL ="INSERT INTO TABELLA1 (ID) VALUES ('"&VALORE&"')" SQL ="INSERT INTO TABELLA2 (ID) VALUES ('"&VALORE&"')" SQL ="INSERT INTO TABELLA3 (ID) VALUES ('"&VALORE&"')" SQL ="INSERT INTO TABELLA4 (ID) VALUES ('"&VALORE&"')" conn.Execute (SQL) ....
Digital XP - The new expression of digital art! - http://www.mimanchitu.it
NO. punto
Così ti esegue solo l'ultima, perchè l'ulitma "sovrascrive" le precedenti.Originariamente inviato da iadream
scusa cioè devo fare:
Non posso fare un'unica INSERT visto che il valore da inserire è sempre lo stesso?codice:SQL ="INSERT INTO TABELLA1 (ID) VALUES ('"&VALORE&"')" SQL ="INSERT INTO TABELLA2 (ID) VALUES ('"&VALORE&"')" SQL ="INSERT INTO TABELLA3 (ID) VALUES ('"&VALORE&"')" SQL ="INSERT INTO TABELLA4 (ID) VALUES ('"&VALORE&"')" conn.Execute (SQL) ....
Al limite puoi fare così:
codice:arrayTabelle array("tabella1","tabella2","tabella3","tabella4") for i = 0 to uBound(arrayTabelle) sql = "INSERT INTO " & arrayTabelle(i) & " (ID) VALUES ('" & valore & "')" conn.execute(sql) next