Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 482699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:07:20+00:00 2026-05-13T01:07:20+00:00

We have 200+ views in Oracle that should be transfomed to 200+ flat files

  • 0

We have 200+ views in Oracle that should be transfomed to 200+ flat files with fixed length fields.

Hoping to get ideas to do a better design of the following migration routine.

The prototype of migration program looks like this for the view named VIEWNAME1 (and are the same for other views in the prototype):

StronglyTypedDataSet views = new StronglyTypedDataSet();
ViewName1TableAdapter tableAdapter = new ViewName1TableAdapter();
tableAdapter.Fill(views.VIEWNAME1   );
mapFromViewToFlatFile(views.VIEWNAME1);

Currently we are using ODT (Oracle Developer Tools) for .Net with c#.

The mapping routine for each view:

private void mapFromViewToFlatFile(DataTable table)
{
            StringBuilder format = BuildFormat();
            StringBuilder outBuf = new StringBuilder();
            foreach (views.VIEWNAME1Row row in table.Rows)
            {
                OneRow(outBuf, format, row);
            }
            SerializeToFile(outBuf, FILENAME);
}

private void OneRow(StringBuilder outBuf, StringBuilder format,views.VIEWNAME1Row row)
{
    outBuf.AppendFormat(format.ToString(),
                    row.COLUMNNAME1.Trim(),
                    row.IsCOLUMNNAME2Null() ? string.Empty : row.COLUMNNAME2.Trim()
     );
    OutBuf.AppendLine();
}


private StringBuilder BuildFormat()
{
        StringBuilder format = new StringBuilder();
        format.Append("{0,-14}");
        format.Append("{1,-36}");
        return format;
}

After writing the
10th private OneRow() function
and 10th private BuildFormat() function (one for each view in Oracle, the code smells).
And I know this can be done better and faster that would enable easier setup of new views, and handles changes easier.

Any suggestions are welcome.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:07:21+00:00Added an answer on May 13, 2026 at 1:07 am

    If the fixed lengths of the columns in the table match the lengths in the file, then you can generically query the user_tab_columns to see the column sizes. Then you could build your format automatically from the database metadata.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently in my iPhone application I have about 200 image views, and I will
I have about 200 categories that are nested. I am currently reading the documention
I have a link marked :remote => true that makes a get request to
I have a little trouble grasping the concept of making views that will display
I have a rails application that talks to Oracle. In average, I have a
I have a custom view that is scaling to 200% when the user clicks
I have an application that contain some simple animations, just hiding Views when user
I have an android application with a gallery that switches between textswitcher views. It
I have a Rails application that uses static html pages (not in app/views/) sending
I am writing unittests for django views. I have observed that one of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.