Help
-
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:
-
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:
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.
-
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:
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.
-
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.
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!
-
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.
-
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:
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
-
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:
-
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.
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