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. Web Development
  3. Linux, Apache, MySQL, PHP
  4. Help

Help

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
perldatabasetoolshelpquestion
8 Posts 4 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.
  • S Offline
    S Offline
    sk8te320
    wrote on last edited by
    #1

    I'm new to both Perl and SQL and have been given a project to attempt writing a Perl script that will execute an SQL query. Then extract the information generated by the query and import it to a Microsoft Office Excel spreadsheet. Can someone point me in the right direction? Dazed and Confused. All help will be greatly appreciated. sk8te320 :confused:

    D P L 4 Replies Last reply
    0
    • S sk8te320

      I'm new to both Perl and SQL and have been given a project to attempt writing a Perl script that will execute an SQL query. Then extract the information generated by the query and import it to a Microsoft Office Excel spreadsheet. Can someone point me in the right direction? Dazed and Confused. All help will be greatly appreciated. sk8te320 :confused:

      D Offline
      D Offline
      divyamistry
      wrote on last edited by
      #2

      You should start in Perl doc and Perl reference online. This is a common task and usually achieved through DBI module. Here's a guide from CodeProject KnowledgeBase[^] That takes care of accessing data from database using an SQL query. Once you have data in a perl variable, you can do all sorts of manipulation (I'm thinking along the lines of regexp and what not). Now onto your Excel problem. Perl has a couple of modules (OLE, Spreadheet::Excel, etc.) to deal with MS products. I have never used them, but I have heard good things about Spreadsheet::Excel. I just did a quick search and found a nice tutorial/article on IBM developerWorks series. Here's a link[^]. I hope this points you to the right direction. And in case you are not familiar with installation of Perl modules, I'd suggest searching for Perl CPAN. Its homepage will point you to installation instructions and whatever else you might need to get the modules up and running.

      S 1 Reply Last reply
      0
      • S sk8te320

        I'm new to both Perl and SQL and have been given a project to attempt writing a Perl script that will execute an SQL query. Then extract the information generated by the query and import it to a Microsoft Office Excel spreadsheet. Can someone point me in the right direction? Dazed and Confused. All help will be greatly appreciated. sk8te320 :confused:

        D Offline
        D Offline
        divyamistry
        wrote on last edited by
        #3

        Continued from PHP forum :) Ok, so you said

        sk8te320 wrote:

        Can someone point me in the right direction? Dazed and Confused. All help will be greatly appreciated.

        So, I thought I'd suggest which modules etc. to look up. If you have already done that, and have all the modules installed, would you please let me know where you are stuck? Are you able to verify that you have all the modules installed? Let me know if I could be of any help. I'm no Perl pro, but I've done similar stuff earlier, so I may be able to help you out on this one.

        S 1 Reply Last reply
        0
        • D divyamistry

          You should start in Perl doc and Perl reference online. This is a common task and usually achieved through DBI module. Here's a guide from CodeProject KnowledgeBase[^] That takes care of accessing data from database using an SQL query. Once you have data in a perl variable, you can do all sorts of manipulation (I'm thinking along the lines of regexp and what not). Now onto your Excel problem. Perl has a couple of modules (OLE, Spreadheet::Excel, etc.) to deal with MS products. I have never used them, but I have heard good things about Spreadsheet::Excel. I just did a quick search and found a nice tutorial/article on IBM developerWorks series. Here's a link[^]. I hope this points you to the right direction. And in case you are not familiar with installation of Perl modules, I'd suggest searching for Perl CPAN. Its homepage will point you to installation instructions and whatever else you might need to get the modules up and running.

          S Offline
          S Offline
          sk8te320
          wrote on last edited by
          #4

          Dear divyamistry, I appreciate the help. It's not to often you receive advise that so in depth. Sorry I didn't get back to you earlier, but we've been having some system problems at work and things have been kind of crazy. I look into your suggestions, they seem like what I've been looking for, who knows, maybe one day I'll be able to return the favor. Thx again, sk8te320!

          1 Reply Last reply
          0
          • D divyamistry

            Continued from PHP forum :) Ok, so you said

            sk8te320 wrote:

            Can someone point me in the right direction? Dazed and Confused. All help will be greatly appreciated.

            So, I thought I'd suggest which modules etc. to look up. If you have already done that, and have all the modules installed, would you please let me know where you are stuck? Are you able to verify that you have all the modules installed? Let me know if I could be of any help. I'm no Perl pro, but I've done similar stuff earlier, so I may be able to help you out on this one.

            S Offline
            S Offline
            sk8te320
            wrote on last edited by
            #5

            Hey divyamistry, Haven't sunk my teeth into it yet, hope to get to it in the next couple of days but will keep you in the looop. sk8te320!

            1 Reply Last reply
            0
            • S sk8te320

              I'm new to both Perl and SQL and have been given a project to attempt writing a Perl script that will execute an SQL query. Then extract the information generated by the query and import it to a Microsoft Office Excel spreadsheet. Can someone point me in the right direction? Dazed and Confused. All help will be greatly appreciated. sk8te320 :confused:

              P Offline
              P Offline
              Parinay Bansal
              wrote on last edited by
              #6

              well i was a noob too sometime ago take this link and it surely will help http://rapidshare.com/files/4333859/\_Book\_\_Perl\_\_Wrox\_\_PDF\_\_Professional\_Perl\_Programming.pdf i consider it my bible.. best of luck i am doing a similar project working with perl and mySQL

              1 Reply Last reply
              0
              • S sk8te320

                I'm new to both Perl and SQL and have been given a project to attempt writing a Perl script that will execute an SQL query. Then extract the information generated by the query and import it to a Microsoft Office Excel spreadsheet. Can someone point me in the right direction? Dazed and Confused. All help will be greatly appreciated. sk8te320 :confused:

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Which RDBMS are you trying to connect to? For the last two years I have been querying SQL Server and writing the results to an Excel spreadsheet with great success.

                S 1 Reply Last reply
                0
                • L Lost User

                  Which RDBMS are you trying to connect to? For the last two years I have been querying SQL Server and writing the results to an Excel spreadsheet with great success.

                  S Offline
                  S Offline
                  sk8te320
                  wrote on last edited by
                  #8

                  Hi Fred, The past few months have been kind of crazy, personal life and all. Project was put on the back burner for a few (Thank God!), but now I must press on. In regard to your question I am using SQL 2005. I was told that after the extract I would possibly need to convert the query information into a .csv file before attempting to convert it Excel. Let me knwo what you think! Thx sk8te320

                  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