Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. Which architecture for a data-extractor

Which architecture for a data-extractor

Scheduled Pinned Locked Moved Design and Architecture
databasequestionsalesarchitecture
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    ZioCharles
    wrote on last edited by
    #1

    Hi There, :-D I have to develop a program (winform) that extracts data from the queries on a DB MSSQL2008 and data are written to a text file in the default locations. The customer asks me to build something dynamic in the sense that if he must add an information to the file or change the value of a field should do so only by adding or modifying the appropriate query. The initial idea is to save in a table the queries needed to extract the value of any information and execute one, then place it in a database the result of support where the tables have the same layout of records in the file to be produced. According to you, wanting to use an approach object-Orientes rather than structural way, how should I organize the source? If you can think of even a better solution to get the result and what is well pleasing. Thanks

    J 1 Reply Last reply
    0
    • Z ZioCharles

      Hi There, :-D I have to develop a program (winform) that extracts data from the queries on a DB MSSQL2008 and data are written to a text file in the default locations. The customer asks me to build something dynamic in the sense that if he must add an information to the file or change the value of a field should do so only by adding or modifying the appropriate query. The initial idea is to save in a table the queries needed to extract the value of any information and execute one, then place it in a database the result of support where the tables have the same layout of records in the file to be produced. According to you, wanting to use an approach object-Orientes rather than structural way, how should I organize the source? If you can think of even a better solution to get the result and what is well pleasing. Thanks

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      Rephrasing.... What you want to do is the following 1. Query a database 2. Write the results to a file. Based on that a simple solution is based on the following - the query is a single sql select. If so then you do the following. 1. The sql statement (select) is read from a configuration source. 2. The database layer sequences through the result set columns using a 'get string' api. It also checks for nulls appropriately. 3. An appropriate text output form is defined. It should be capable of dealing with nulls and things like embedded quotes. I would suggest: a. Use tab for a delimiter b. For each string value strip out all tabs, and end of line characters and replace with spaces. 4. You put 1, 2, 3 together to write to the file. Additional items - I suggest that you allow for a configurable file location and file name. Trying to generalize to more complex examples is probably pointless. Too much generalization ends up recreating things that already exist such a programming languages and report generators.

      A 1 Reply Last reply
      0
      • J jschell

        Rephrasing.... What you want to do is the following 1. Query a database 2. Write the results to a file. Based on that a simple solution is based on the following - the query is a single sql select. If so then you do the following. 1. The sql statement (select) is read from a configuration source. 2. The database layer sequences through the result set columns using a 'get string' api. It also checks for nulls appropriately. 3. An appropriate text output form is defined. It should be capable of dealing with nulls and things like embedded quotes. I would suggest: a. Use tab for a delimiter b. For each string value strip out all tabs, and end of line characters and replace with spaces. 4. You put 1, 2, 3 together to write to the file. Additional items - I suggest that you allow for a configurable file location and file name. Trying to generalize to more complex examples is probably pointless. Too much generalization ends up recreating things that already exist such a programming languages and report generators.

        A Offline
        A Offline
        Aneesh Warrier
        wrote on last edited by
        #3

        Not sure you are still looking for an answer. You can do something like a Key and value(payload),ie sql will be for just fetching the value for the given key. Here the value will be a payload(a XML string). You will have template for the xml format. whenever you want to add something you just add it the template. while writing to file you first fetch the payload, then parse the XML, put the parsed values to a file, in what format you want.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups