|
Question : Export data from excel sheet to oracle
|
|
Hi Could anyone please help me with the update query. iam uploading data's from an access database to oracle table. here's my coding. please help me what would be the update query if i want to update the existing data in the oracle table. here's the coding for loading the data's , but i want the update query . please help me.
Dim xlconn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1.mdb") Dim xlda As New OleDbDataAdapter("select * from sheet1", xlconn) Dim xldt As New DataTable xlda.Fill(xldt) xlda.Dispose() xlconn.Close()
Dim conn As New OracleClient.OracleConnection("Data Source=PRICING_DATA;User ID=PRICING;Password=pr1c1ng") 'Dim DR As OracleClient.OracleDataReader conn.Open() Dim cmd As OracleClient.OracleCommand = conn.CreateCommand
cmd.CommandText = "SELECT * FROM test_erp_crossreference" cmd.ExecuteNonQuery() Dim da As New OracleClient.OracleDataAdapter(cmd) Dim cb As OracleClient.OracleCommandBuilder = New OracleClient.OracleCommandBuilder(da) Dim ds As New DataSet da.Fill(ds, "test_erp_crossreference")
For Each xlrow As DataRow In xldt.Rows Dim dr As DataRow = ds.Tables("test_erp_crossreference").NewRow For Each col As DataColumn In ds.Tables("test_erp_crossreference").Columns dr(col.ColumnName) = xlrow(col.ColumnName) Next ds.Tables("test_erp_crossreference").Rows.Add(dr) Next
da.Update(ds, "test_erp_crossreference") Response.Write("")
da.Dispose() conn.Close()
|
|
Answer : Export data from excel sheet to oracle
|
|
select * from excel_table where product_key='somedata' then get values for columns product_key abd product_no and update oracle table with their values
|
|
|
|