.NET
  Home arrow .NET arrow .NET Stored Procedures: Autogenerating INS...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

.NET Stored Procedures: Autogenerating INSERT Statements for rows in Oracle Tables
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 6
    2005-12-20

    Table of Contents:
  • .NET Stored Procedures: Autogenerating INSERT Statements for rows in Oracle Tables
  • Developing Oracle based .NET CLR stored procedure using Visual Studio.NET
  • Understanding the .NET CLR Stored Procedure
  • Understanding the .NET CLR Stored Procedure - continued
  • Deploying and testing the Oracle based .NET CLR stored procedure using Visual Studio.NET

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    .NET Stored Procedures: Autogenerating INSERT Statements for rows in Oracle Tables


    (Page 1 of 5 )

    In this article, I shall introduce you to developing a .NET based CLR stored procedure, which can generate INSERT commands automatically for every row in a specified SELECT statement against an Oracle database.
    A downloadable file for this article is available here.
    Preparing before developing a .NET CLR stored procedure

    I already introduced .NET based stored procedures in Oracle databases in my article ".NET CLR stored procedures within Oracle database: Another breaking revolution."   If you are very new to this concept (or having trouble working with the Oracle wizard in this article), I suggest you go through that article before proceeding further.

    Before proceeding further with this article, make sure that all of the following software is properly installed and configured on your system:

    In some real scenarios, we may need to provide INSERT commands to the customer, to have some default rows to be inserted into some of the tables.  If we have rows in an Oracle table, and we would like to generate INSERT commands for all of those, it would be very difficult to achieve (unless you are an expert in PL/SQL).  In this article I dare to achieve it, but by using a .NET stored procedure.

    The .NET stored procedure that we are going to develop in this article will create a text file and place all auto-generated INSERT commands automatically.  It basically accepts any SELECT statement for fetching all the rows.  We also need to provide the table name on which the INSERT command should be based.  And finally we provide a filename (along with the path) to hold all the INSERT statements.  But you must make sure that the file is generated only at the server (unless you provide a network shared path).

    As this is a demonstration, I simply worked with the table “emp” which relies on the SCOTT schema.  My entire source code focuses on the “SCOTT” schema.  I suggest that you make the necessary changes to the source code, if you create (or modify) the table in a different schema.

    I assume that you have already connected to the Oracle database using “Oracle Explorer” using Visual Studio.NET 2003.  If you are not quite familiar with “Oracle Explorer,” you will want to refer to my article linked several paragraphs above.

    Now we shall proceed to the next section, which deals with creating the stored procedure.

    More .NET Articles
    More By Jagadish Chaterjee


       · Hello guys, this is my second article on .NET CLR stored procedures in Oracle. Enjoy...
     

    .NET ARTICLES

    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek