bonjour hnb2003,
J'ai retrouvé la définition de DUAL:
DUAL is a table automatically created by Oracle along with the data dictionary.
DUAL is in the schema of the user SYS, but is accessible by the name DUAL to all users. It has one column, DUMMY, defined to be VARCHAR2(1), and contains one row with a value ’X’. Selecting from the DUAL table is useful for computing a constant expression with the SELECT statement. Because DUAL has only one row, the constant is returned only once. Alternatively, you can select a constant, pseudocolumn, or expression from any table, but the value will be returned as many times as there are rows in the table.
Si tu crée dans ta base une table à un seul enregistrement et que tu l'appelle DUAL, tu pourra mettre la clause FROM DUAL dans ta requête et elle fonctionnera. C'est ce que j'ai fait avant d'envoyer ma première réponse.
Sinon, tu mets tes valeurs dans une table temporaire
1. supprimer la table temporaire si elle existe.
1 2 3
| On Error Resume Next
DoCmd.RunSQL "DROP TABLE zTMP;"
On Error GoTo 0 |
2. stocker les valeurs en créant une table
"SELECT '" & variableVBA1 & "' AS id, " & variableVBA2 & "' As nom, '" & variableVBA3 & "' as prenom" & " INTO zTmp;"
3. Requête ajout.
1 2 3
| INSERT INTO client (id, nom, prenom)
SELECT zTmp.id, zTmp.nom, zTmp.prenom FROM zTmp LEFT JOIN Client ON zTmp.id=Client.id
WHERE ((Client.id) Is Null); |
Bonne continuation.
Partager