[plug] Re: [OT] SQL column splitting

Bret Busby bret at busby.net
Fri Nov 19 15:21:44 WST 2004


On Tue, 16 Nov 2004, James Devenish wrote:

> Date: Tue, 16 Nov 2004 09:28:28 +0800
> From: James Devenish <devenish at guild.uwa.edu.au>
> Reply-To: plug at plug.linux.org.au
> To: plug at plug.linux.org.au, draoidh at iinet.net.au
> Subject: Re: [plug] Re: [OT] SQL column splitting
> 
> In message <20041116005028.GI19926 at localhost>
> on Tue, Nov 16, 2004 at 08:50:29AM +0800, PEter Crystal wrote:
> > of course, if the data is presented in just columns of data
> > in a text file perl could handle it relatively easy.
> 
> Sure :) I guess you and Bret wanted to highlight the obviousness of such
> an approach. The problem for me is that this is part of a larger set of
> systems that have been built up over time (and I was also hoping for a
> solution that would not involve perturbation of the existing tables or
> applications). 

Can you please clarify this - in terms of exactly what you want?

It sounds to me (not an SQL expurt), that what you want to do, is to 
create a view, rather than a data transformation, as you appear to want 
to leave the original table intact.

Do you want simply to have a routine to retrieve the data in the format 
that you wanted, or, do you want a view created, or, do you want an 
extra table created, that has the format that you specified?

I had suggested Perl, as I believed that what you wanted, was a report 
generated, and that the control structures and other functionality in 
Perl, that are not generally present in simple SQL, could be more 
appropriate than trying to do it in SQL, but, in thinking about it, with 
your responses, I am not sure now, as to exactly what you seek.

If what you wanted, was simply a report, then I believe that a script 
written in Perl, with embedded SQL, would probably be the simplest and 
quickest solution, but I suppose that it depends on what is the overall 
environment, and, what exactly you want as the outcome.

I note that Anne had posted an SQL solution, but you appear to have not 
responded to that one. Was that one not appropriate? She is a database 
developer, so may be better able to help than me.

-- 
Bret Busby
Armadale
West Australia
..............

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
  Chapter 28 of 
  "The Hitchhiker's Guide to the Galaxy:
  A Trilogy In Four Parts",
  written by Douglas Adams, 
  published by Pan Books, 1992 
....................................................





More information about the plug mailing list