http://qs1969.pair.com?node_id=187603

johnirl has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, in my current program I have a routine that retrieves results from my database. Currently I display the results from each statment in the following form.

Result 1; R1something1 ; R1something2 ; R1something5 ; R1something6 ; R1something7 ; R1something8 ; Result2; R2something1 ; R2something2 ; R2something3 ; R2something4 ; R2something5 ; R2something6 ; R2something7 ; R2something8 ; R2something9 ; R2something 10;

But I want to display them beside each other to aid with comparisons. Like so:

Result 1 Result2 R1something1 ; R1something2 ; R2something1 ; R2something2 ; -- ; -- ; R2something3 ; R2something4 ; R1something5 ; R1something6 ; R2something5 ; R2something6 ; R1something7 ; R1something8 ; R2something7 ; R2something8 ; -- ; -- ; R2something9 ; R2something10;

I also need to know how I would substitute a null value with a "--" in my output file as I want the results that satisfy the same conditions beside each other and the results with no corresponding results in the other table should still be displayed i.e. R2Something 9 & 10 above.
I am retrieving results row by row. But I am unsure of how to switch between the statements. Will I have to retrieve all results for one sql statement and then begin the second? Or can I switch between the two? Or is there some funky perl module that can take care of this for me?
Any help you can give is appreciated
Thanks Monks

JohnIrl

Sum day soon I'Il lern how 2 spelI (r tYpe)