Re: Why use Pro*C for spooling result sets to flat files when you can do the same thing in SQL*Plus?

  • From: Peter Hitchman <pjhoraclel@xxxxxxxxx>
  • To: oracle-l <oracle-l@xxxxxxxxxxxxx>, bwmyers@xxxxxxxxx
  • Date: Mon, 6 Sep 2010 14:27:12 +0100

Hi,
Like some others I have written a lot of PRO*C  in the past but now we
do all that in Java and JDBC plus other stuff like the Spring
framework. I always thought of PRO*C as  in the purview of the
developer, because as you will find out you need to be able to code in
C/C++ to use it, in then end all PRO*C is, is a way of embedding SQL
into C/C++ code. Having said that I always saw it a nice middle ground
to achieve good performance over the complexity of using the OCI API.
To use it just to write out data to text files is over kill for me,
(except that it probably limits what you need to know about "C" to the
printf statement!) given the source edit/compile/link steps you have
to go through (although this can be painless if your makefiles are
good enough, back in the day I was quite the guru in that area). You
did not say if you are in a Unix type environment but you can achieve
much the same with sqlplus and the "here document" shell scripting
approach and as Jared has said PERL with DBI also goes a long way
without having to create executables and there are also the other
scripting languages like Python,PHP etc etc that all interface to
Oracle. I understand and applaud your willingness to learn PRO*C, but
you may well be right that there is a better more efficient way to
achieve the goal, I guess you just have to try slowly to see if you
can bring that in and that is from someone who spent the best part of
15 years as a C/C++ coder!

good luck

Pete

On Thu, Sep 2, 2010 at 8:56 PM, Bill Myers <bwmyers@xxxxxxxxx> wrote:
> Thanks for all of the responses.
>
> It seems that they have more Pro*C-savvy developers that are less savvy with
> SQL*Plus. After thinking about the situation and what really matters to me
> at work politically and outside work personally, I told the lead DBA this
> morning that I would learn Pro*C. I'll pick and choose my battles once I
> have gained some ground here. At least I have this venue to freely express
> my professional interests and insights.
>
> Thanks again!
> Bill
>
--
//www.freelists.org/webpage/oracle-l


Other related posts: