How do i Pass a Data Table in asp.net to a procedure in oracle database

  • Hi,

    I am having a datatable with 3 columns and say like 100 rows. I want to store this data into a oracle database. Now how do i pass this table to the oracle database....i am new to writing stored procedures and any help with the syntax would be appreciated. one suggestion was made to use a temp table....how does that work...can some one elaborate

  • What exactly do you need to do on the Oracle server with that data?

    You can look up linked servers in BOLs and dts export data to do this task.

  • i just need to put this data into a table having 3 columns in oracle data base...and this is the first time i am using oracle data base...so i dont know what are bols....if there are any links that u can provide..i would appreciate that

     

    thanks

  • BOLs = books online (help file that comes with sql server).

    In enterprise manager :

    1 - Right click on your database

    2 - Export data...

    3 - Follow the wizard and you should be fine.

  • Is it the same with oracle database...i am using toad for oracle databse.....how to work this with asp.net

  • I don't know how to do it from the oracle side... maybe someone else here knows but I guess you'd have better luck on an Oracle site.

  • Hi,

    I am an experienced Oracle DBA (7 years) and currently,  I am learning MS SQL 2000.

    What is your exact problem with Oracle ?

    Please provide details of Unix box version Operating System version, Oracle DB version, database design, and table names etc...

    Also, provide me how you wish to load data, via SQL*Plus, SQL*Loader, TOAD, etc

    Jules

  • I am not an Oracle DBA, but I would not think that you could pass a data table directly into a procedure. One way you might be able to do it is, if the version of Oracle you are using supports the XML datatype, convert the data table to XML and pass it as a parameter to the ORacle procedure and manipulate the XML there to insert into the table.

    Another option would be to set the insert command of your dataadapter to be a command using a connection to the Oracle DB using the Oracle .NET Data porvider. Then the Provider would handle all the syntax for you.

  • Jack thx for the reply,

    I have tried to fill data into my dataadaptor from the table in the database.

    Dim

    cmd As OracleCommand = New OracleCommand("SELECT * FROM HPS_LOG_HISTORY", conn1)

    Dim da As OracleDataAdapter = New OracleDataAdapter(cmd)

    da.Fill(ds1, "dt")

     Now i want to associate another table of a new dataset ds on my page to this adapter

    ds1 = ds.Copy

    dt = ds.Tables(0).Copy

     

    then i am trying to update

    Dim

    objcommandbuilder As OracleCommandBuilder = New OracleCommandBuilder(da)

    da.Update(ds1, "dt")

    conn1.Close()

     

    i am getting this exception.....saying

     

    Update unable to find TableMapping['dt1'] or DataTable 'dt1'.

  • Hey ,

    I have used string builer to convert the data table into a string format(to be precise xml format)....then i have created a table in oracle which takes xmltype data.  Now i am able to pass data into the table using myadapter.update method.

     

    thx

     

  • Why not simply creating a temp table, make an insert statement and using that instead??

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply