Perl or PL/SQL?Posted: September 19, 2007
It happens every three month – the project managers need to generate their quarterly report. Every three month they decide that the reports they used until now are not good enough and they come up with a new design for the report. The DBAs now need to get the data, preferably yesterday. After we gather the data and create the report, there is another week during which we try to convince them that the results are correct and they try to convince us to massage the data a bit to reflect the results they expected.
This time, to generate the report I need to collect data from six different databases which together contain about 30 schema, one of them is SQL Server. Sounds like fun already.
Naturally, I want to write a script that will run all the necessary queries, do all the necessary calculations and aggregations, and dump everything into a table. Then I’ll grab the results from that table and put them into a nice looking Excel (with graphs and colors!).
My only dilemma is: Perl or PL/SQL?
- I know Perl much better than PL/SQL, so I’ll get it written fast and more correctly.
- Perl has no problem connecting to SQL Server – I’m kind of worried it may be an issue with PL/SQL.
- If I do the report in Perl, I won’t have to create all those linked servers to all the other systems. Our security team dislikes linked servers.
- Well, learning PL/SQL was one of my objectives this year – so this is a great opportunity.
- It will probably run much faster. I can’t be sure about it at this stage, but this is usually true.
- Other DBAs can maintain PL/SQL code. I’m the only one who does Perl.
I think that if I’ll find a way to get the SQL Server data from PL/SQL, I’ll go the PL/SQL route. I think its called “heterogeneous server”, but last time I checked it was quite complicated to use. Maybe it is worth a second chance.