1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
| Dim CmdOracle As New OracleCommand(TextSql, DBOracle1)
Dim inserts As New StringBuilder()
DrORacle = CmdOracle.ExecuteReader
If DrORacle.HasRows Then
Do While DrORacle.Read
Enseigne = DrORacle.GetString(0).ToString
Saison = DrORacle.GetString(1).ToString
Nom = DrORacle.GetString(2).ToString
NumCommande = DrORacle.GetString(3).ToString
Buyer = DrORacle.GetString(4).ToString
Famille = DrORacle.GetString(5).ToString
Coloris = DrORacle.GetString(6).ToString
If Not DrORacle.IsDBNull(7) Then
LibColoris = Strings.Replace(DrORacle.GetString(7).ToString, "'", "''")
Else
LibColoris = "N/A"
End If
If Not DrORacle.IsDBNull(8) Then
CodeGrilleTaille = DrORacle.GetInt32(8)
Else
CodeGrilleTaille = 0
End If
If Not DrORacle.IsDBNull(9) Then
LibGrilleTaille = DrORacle.GetString(9).ToString
Else
LibGrilleTaille = "N/A"
End If
Fournisseur = Strings.Replace(DrORacle.GetString(10).ToString, "'", "''")
OTB = Strings.Replace(DrORacle.GetString(11).ToString, "'", "''")
Themes = Strings.Replace(DrORacle.GetString(12).ToString, "'", "''")
If Not DrORacle.IsDBNull(13) Then
DistriProd = Strings.Replace(DrORacle.GetString(13).ToString, "'", "''")
Else
DistriProd = "N/A"
End If
PlieSup = DrORacle.GetString(14).ToString
MEPREA = DrORacle.GetString(15).ToString
Paht = DrORacle.GetDecimal(16)
QttCommande = DrORacle.GetInt32(17)
QttLivre = DrORacle.GetInt32(18)
QttResteALivre = DrORacle.GetInt32(19)
Dim Jour, Mois, Annee As String
Jour = "00" & DrORacle.GetOracleDate(20).Day.ToString
Mois = "00" & DrORacle.GetOracleDate(20).Month.ToString
Annee = DrORacle.GetOracleDate(20).Year.ToString
DateLivraison = Annee & "-" & Strings.Right(Mois, 2) & "-" & Strings.Right(Jour, 2)
If Not DrORacle.IsDBNull(21) Then
Jour = "00" & DrORacle.GetOracleDate(21).Day.ToString
Mois = "00" & DrORacle.GetOracleDate(21).Month.ToString
Annee = DrORacle.GetOracleDate(21).Year.ToString
DDM = Annee & "-" & Strings.Right(Mois, 2) & "-" & Strings.Right(Jour, 2)
Else
DDM = "1900-01-01"
End If
If Not DrORacle.IsDBNull(22) Then
Jour = "00" & DrORacle.GetOracleDate(22).Day.ToString
Mois = "00" & DrORacle.GetOracleDate(22).Month.ToString
Annee = DrORacle.GetOracleDate(22).Year.ToString
DateDIM = Annee & "-" & Strings.Right(Mois, 2) & "-" & Strings.Right(Jour, 2)
Else
DateDIM = "2050-12-31"
End If
If Not DrORacle.IsDBNull(23) Then
RefFourn = Strings.Replace(DrORacle.GetString(23).ToString, "'", "''")
Else
RefFourn = "N/A"
End If
If Not DrORacle.IsDBNull(24) Then
Stagged = Strings.Replace(DrORacle.GetString(24).ToString, "'", "''")
Else
Stagged = "N/A"
End If
If Not DrORacle.IsDBNull(25) Then
Ironing = Strings.Replace(DrORacle.GetString(25).ToString, "'", "''")
Else
Ironing = "N/A"
End If
If Not DrORacle.IsDBNull(26) Then
OnHanger = Strings.Replace(DrORacle.GetString(26).ToString, "'", "''")
Else
OnHanger = "N/A"
End If
inserts.Append("insert into gat (enseigne, saison, nom, commande, buyer, famille, coloris, libcoloris, codegrilletaille, libgrilletaille, fournisseur, otb, themes, paht, qttcommande, qttlivre, qtereste, datelivraison, ddm, dim, pliesup, meprea, distriprod, reffourn, stagged, ironing, onhanger ) values ('" & Enseigne & "', '" & Saison & "', '" & Nom & "', " & NumCommande & ", '" & Buyer & "', '" & Famille & "', '" & Coloris & "', '" & LibColoris & "', " & CodeGrilleTaille & ", '" & LibGrilleTaille & "', '" & Fournisseur & "', '" & OTB & "', '" & Themes & "', '" & Paht & "', " & QttCommande & ", " & QttLivre & ", " & QttResteALivre & ", '" & DateLivraison & "', '" & DDM & "', '" & DateDIM & "', '" & PlieSup & "', '" & MEPREA & "', '" & DistriProd & "', '" & RefFourn & "', '" & Stagged & "', '" & Ironing & "', '" & OnHanger & "');" & VbCrLf) ' Note: j'ai ajouté le point virgule à la fin pour séparer les instructions
Loop
TextSql = inserts.ToString()
Dim CmdTraitement As New MySqlCommand(TextSql, DBMysql5)
CmdTraitement.ExecuteNonQuery()
End If
DrORacle.Close() |
Partager