I want to do a bulk data transfer from Oracle 10.2G into CSV or Excel sheet.I would either want that an entire table's data be populated into EXcel/CSV or the result of a select query be so populated.
1)Is there any stored procedure or function that can do this?
I know of a function in postgres which does this kind of a thing.There could be something similar.The second thing is the reverse of it.I want to transfer the contents of a CSV file into a oracle table after truncating it.
I want to transfer data from an acces database to a sqldatabase. This is my code:
using System; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Data.OleDb; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class _Default : System.Web.UI.Page { #region page load protected void Page_Load(object sender, EventArgs e) { } #endregion protected void click_Transfer(object sender, EventArgs e) { OleDbConnection conn1 = null; OleDbDataAdapter da1 = null; DataSet ds1 = null; SqlConnection conn2 = null; SqlDataAdapter da2 = null; DataSet ds2 = null; // 1 Opzetten dataAdapter en dataset try { // Ophalen connectiestring en opzetten v/d connectie string connString1 = ConfigurationManager.ConnectionStrings["PrinterConnectionString"].ToString(); conn1 = new OleDbConnection(connString1); string connString2 = ConfigurationManager.ConnectionStrings["PrinterConnectionString2"].ToString(); conn2 = new SqlConnection(connString2); // Aanmaken van DataAdapters da1 = new OleDbDataAdapter(); da2 = new SqlDataAdapter(); // Opzetten SelectieCommand string sql1 = "SELECT * FROM tblPrinter"; OleDbCommand cmd1 = new OleDbCommand(sql1, conn1); SqlCommand cmd2 = new SqlCommand(sql1, conn2); da1.SelectCommand = cmd1; da2.SelectCommand = cmd2; string sql2 = @"INSERT INTO tblPrinter(PRINTER_ID, tblSoortApparaat, MERK, MODEL, LOKAAL_ID )" + @"VALUES (@id, @soort, @merk, @model, @lokaal)"; cmd2 = new SqlCommand(sql2, conn2); // InsertCommand dataAdapter cmd2.Parameters.Add("@id", SqlDbType.Int, 0, "PRINTER_ID"); cmd2.Parameters.Add("@soort", SqlDbType.NVarChar, 100, "tblSoortApparaat"); cmd2.Parameters.Add("@merk", SqlDbType.NVarChar, 100, "MERK"); cmd2.Parameters.Add("@model", SqlDbType.NVarChar, 100, "MODEL"); cmd2.Parameters.Add("@lokaal", SqlDbType.Int, 0, "LOKAAL_ID"); da2.InsertCommand = cmd2; ds1 = new DataSet(); da1.Fill(ds1, "PRINTERS"); ds2 = new DataSet(); da2.Fill(ds2, "PRINTERS2"); // Stap 2: Start bewerking!! DataTable table1 = ds1.Tables["PRINTERS"]; DataTable table2 = ds2.Tables["PRINTERS2"]; DataRow newrow = null; for (int i = 0; i < table1.Rows.Count; i++) { newrow = table2.NewRow(); newrow["PRINTER_ID"] = i + 1; newrow["tblSoortApparaat"] = table1.Columns[1].; newrow["MERK"] = table1.Columns[2].DefaultValue; newrow["MODEL"] = table1.Columns[3].DefaultValue; newrow["LOKAAL_ID"] = table1.Columns[4].DefaultValue; table2.Rows.Add(newrow); } da2.Update(ds2, "PRINTERS2"); lblMessage.Text = table1.Rows.Count.ToString() + " rijen zijn toegevoegd"; // bindgrid(); } catch (Exception ex) { lblError.Text = ex.Message; } } }
Here is my problem newrow["tblSoortApparaat"] = table1.Columns[1].; When i do that al the rows in my sql database are filt up with the columname. But i want the specik data. For example sql database:
i am doing cmd.ExecuteNonQuery();I am able to get the number and varchar2 values from output parameters. But i am unable to get output from Ref Cursor. (How can i get this...)If i use dataadaptor then i am getting the datatable in the dataset(but i am not getting the other two parameters(where will get the other two??)...
I'm using ASP.NET C# with the v3.5 framework, and need to grab data from the session and insert it into an Oracle database. I can connect to the database and manually insert data from a couple of controls I created. However, I have an application with multiple forms that stores data in the session as the user navigates between the forms. The form information is stored in DataTables, with a separate DataTable for each form. I have an idea of how to retrieve the data, but was wondering if I have to code queries to map each field in the database to the fields in the forms? Or is there a way to "give" the database the information from the DataTable and have it insert each of the values?
am in deep trouble with retriving the data from oracle database. Please HELP ! In one line: "When i retrive the data from oracle database, it's truncate the data if it is more than 4 kb"I have oracle proc param as below:
PROCEDURE p_GetData ( ivar_id IN id_n%TYPE, oclb_owners OUT CLOB, onum_sqlcode OUT NUMBER, [code]...
I`m extremely newbie to asp.net and oracle but i need to make a very simple project where asp.net inserts/updates data is oracle db. A managed to the connections, everything, made a DetailView of the DB data on the page, enabled in the Advanced SQL Generation Options the "Generate INSERT, DELETE and UPDATE statesments". Here is the code:
[Code]....
But unfortunately this does not work! I get the following error:
[Code]....
Oracle gives me creeps with these invalid characters and dates.
I am fetching data from oracle data base in asp.net application. To achieve this functionality i have used Oracle.DataAccess dll . In my developement enviorment it working fine.
But once I deployed this code on IIS 6.0 it is stopped working and I checked my log and found connection not get established . Then I make sure Oracle.DataAccess.dll present in to bin folder also I try to put this dll in side GAC, but still my code is not working on deployed server.
Getting the following error when browsing .net 2.0 application System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
I have setup a .net 2.0 application with oracle backend on windows server 2008 R2. I have oracle client 11g installed on the server for the application to talk to the oracle database. This worked well when the .net 2.0 application was hosted on windows server 2003 and oracle client 10g. But when it is hosted on server 2008 with new oracle client it is giving the above error when browsing the page. This error occurs when the connection is opened inside the c# code.
i done one web application in this application i need to transfer the data from one table to another automatically when the time is 10.00PM. i need to write this function sepearte time function not in page load function.the user select any of page the data should be transfer from one to another without page load only using time control function..
As the title says I have a Win 7 64 bit dev machine, Win 2K3 32 bit production box and I run against Oracle 10g which Oracle clients do I need to run? Do I need to run the Oracle 32 and 64 bit clients? And if so what versions?
I need to find a way to connect to the remote Oracle server without a DSN. There are some practical problem for accessing the server using a DSN. I need a way to connect to Oracle server like I connect to SQL Server etc. For example, in SQL server, I can connect directly with server using Servername (IP adress) + Username + Password + DB Name. Any way to connect to the Oracle server like in SQL Server we do ??
I have an Asp.net web application targeting .Net2.0 and my databse is oracle, I used SqlDataSource Control to communicate with oracle database its working fine on my development server, but on my production Oracle is 64 bit so im getting an error like
"<asp:ControlParameter doesnot have a property DbType="Int32"> " i tried with Int64 also but still im getting the same error
following is the markup of sqldatasource i used < asp:SqlDataSource ID="sdsEmployees" runat="server" ConnectionString="User Id=user;pwd=user1;server=prod" ProviderName="System.Data.OracleClient" SelectCommand="GetEmployeeInfo" SelectCommandType="StoredProcedure" OnSelecting="sdsEmployees_OnSelecting"> <SelectParameters> <asp:ControlParameter ControlID="txtNumber" DbType="Int32" /> </SelectParameters> </asp:SqlDataSource>
I am developing a web application with back end as Oracle. I call the procedures from web application when ever some update, create or delete for the records needs to be performed. How to maintain the connection in these scenarios.
Can I open the connection and maintain it through out the application till user logs out?
here's my error... Compiler Error Message: CS1502: The best overloaded method match for '_Default.InsertUpdateData(System.Data.SqlClient.SqlCommand)' has some invalid arguments