perl for processing sqlplus spool output

When I wrote my bash script below 3 monthes ago,

fixed length sqlplus spool file for loading data (INOUE Katsumi @ Tokyo)

you need to salvage data from sqlplus spool file


I thought I googled enough not to reinvent the wheel.
But that wasn't enough! One of my colleague's mail lead me to another colleague's blog entry.

Convert sqlplus spool output to CSV « Tyler Muth’s Blog

perl seemed like the best fit as it’s easy, cross platform, and made for text files.

My bash script runs on Windows Cygwin so it's somewhat cross platform. But I recommend using Tyler's perl.
It's more readable and it seems it can handle many corner cases.

Now I remember that there was an internal discussion as to what's the best language to write 'one-off' script.
Kind of consensus at that time was 'perl' as far as Oracle Database is concerned because perl gets installed
under $ORACLE_HOME.

I think python is OK now in Exadata env.

Comments:

Thank you. I was looking for a way to fix this problem for an old customer and found your spool file script here. It saved me a lot of work so much appriciated.

Posted by Erik Nielsen on April 13, 2014 at 06:53 PM JST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today