Creating a database Table From DataTable
I have a live oracle database and test oracle database. i am copy data from my live to my test system, which doesnt have all of the current table that the live system has. so what i would like to do for a table that doesnt exist in my test system, is create a table in my test system from the datatable i created from my live system. is there a way to do this so that i can any indexes, triggers or any other objects that belong to that table?
I believe that you will need to execute the appropriate DDL statements to create the table, indexes, etc. Those database objects will not get created automatically from data in a datatable.
i am can write the DDL statements from properties on the datatable like i have done below:
For Each localColumn As DataColumn In inDatatable.Columns
Dim localField As String = ""
localField = localColumn.ColumnName
If localColumn.DataType.Equals(GetType(String)) Then
localField = localField & " varchar2(" & localColumn.MaxLength & ")"
ElseIf localColumn.DataType.Equals(GetType(Date)) Then
localField = localField & " date"
ElseIf localColumn.DataType.Equals(GetType(Integer)) Then
localField = localField & " numeric"
If Not localColumn.AllowDBNull Then
localField = localField & " NOT NULL"
i was curious to know if there was way to capture the index, relationships, triggers and all other objects, so that i could recreate those also.
Thanx a lot christianbg..... i was finding this solution from long time b4 nd now i got it.... thnx again.....
By software_develo in forum Database
Last Post: 01-31-2006, 11:58 PM
By software_develo in forum .NET
Last Post: 01-02-2006, 11:43 PM
By Robert in forum Database
Last Post: 08-15-2002, 10:57 AM
By Marcus Koontz in forum VB Classic
Last Post: 03-30-2002, 09:03 AM
By Sara Yen in forum VB Classic
Last Post: 06-05-2000, 11:33 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center