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
|
Dim oradb As String = "Data Source=(DESCRIPTION=" _
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=******)(PORT=1521)))" _
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DBTEST)));" _
+ "User Id=***;Password=****;"
Dim conn As New OracleConnection(oradb)
'conn.Open()
Dim myCommand As OracleCommand
Dim strRequete As String
strRequete = "INSERT INTO [GRH.TBL_CANDIDATURE] ( [id_candidat],[id_fonction_vacante],[id_statut],[date_encodage],[lien_cv],[lien_lettre],[lien_doc],[candi_ext_int],[soutien_politique],[candidature_spontanee],[commentaire],[reserve],[date_debut_reserve],[date_fin_reserve],[experience],[date_mail],[word],[lien_word]) VALUES (@id_candidat,@id_fonction_vacante,@id_statut,@date_encodage,@lien_cv,@lien_lettre,@lien_doc,@candi_ext_int,@soutien_politique,@candidature_spontanee,@commentaire,@reserve,@date_debut_reserve,@date_fin_reserve,@experience,@date_mail,@word,@lien_word)"
'str_requete = "INSERT INTO tbl_candidature(id_candidat,id_fonction_vacante,id_statut,date_encodage,lien_cv,lien_lettre,lien_doc,candi_ext_int,soutien_politique,candidature_spontanee,commentaire,reserve,date_debut_reserve,date_fin_reserve,experience,date_mail,word,lien_word) values (1970,29,4,TO_DATE(" & "'12/09/12'" & "'YYYYMMDD')" & ",'','','',0,0,0,'',0,'','','','',0,'')"
myCommand = New OracleCommand(strRequete, conn)
'Création et décalartion des paramètres
With myCommand.Parameters
.Add(New OracleParameter("@id_candidat", OracleDbType.Int32, 4))
.Add(New OracleParameter("@id_fonction_vacante", OracleDbType.Int32, 4))
.Add(New OracleParameter("@id_statut", OracleDbType.Int32, 4))
.Add(New OracleParameter("@date_encodage", OracleDbType.Date))
.Add(New OracleParameter("@lien_cv", OracleDbType.Char, 255))
.Add(New OracleParameter("@lien_lettre", OracleDbType.Char, 255))
.Add(New OracleParameter("@lien_doc", OracleDbType.Char, 255))
.Add(New OracleParameter("@candi_ext_int", OracleDbType.Int16, 1))
.Add(New OracleParameter("@soutien_politique", OracleDbType.Int16, 1))
.Add(New OracleParameter("@candidature_spontanee", OracleDbType.Int16, 1))
.Add(New OracleParameter("@commentaire", OracleDbType.Char, 255))
.Add(New OracleParameter("@reserve", OracleDbType.Int16, 1))
.Add(New OracleParameter("@date_debut_reserve", OracleDbType.Date))
.Add(New OracleParameter("@date_fin_reserve", OracleDbType.Date))
.Add(New OracleParameter("@experience", OracleDbType.Char, 255))
.Add(New OracleParameter("@date_mail", OracleDbType.Date))
.Add(New OracleParameter("@word", OracleDbType.Int16, 1))
.Add(New OracleParameter("@lien_word", OracleDbType.Char, 255))
End With
'Attribution des valeurs aux paramètres
With myCommand
.Parameters("@id_candidat").Value = CInt("1970")
.Parameters("@id_fonction_vacante").Value = CInt("29")
.Parameters("@id_statut").Value = CInt(4)
.Parameters("@date_encodage").Value = CDate("12/09/2012")
.Parameters("@lien_cv").Value = CStr("")
.Parameters("@lien_doc").Value = CStr("")
.Parameters("@lien_lettre").Value = CStr("")
.Parameters("@candi_ext_int").Value = CInt(0)
.Parameters("@soutien_politique").Value = CInt(0)
.Parameters("@candidature_spontanee").Value = CInt(0)
.Parameters("@commentaire").Value = CStr("")
.Parameters("@reserve").Value = CInt(0)
.Parameters("@date_debut_reserve").Value = CDate("12/09/2012")
.Parameters("@date_fin_reserve").Value = CDate("12/09/2012")
.Parameters("@experience").Value = CStr("")
.Parameters("@date_mail").Value = CDate("12/09/2012")
.Parameters("@word").Value = CStr("")
.Parameters("@lien_word").Value = CStr("")
End With
myCommand.Connection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close() |