homerUK
09-14-2006, 08:40 PM
hi guys..
I have the following data which I need to export (for example)
process_name 2002 2003 2004 2005 2006
====================================================
process1 1.23 4.32 234.21 221.43 665.32
process2 0.98 0.34 5.32 2.56 7.56
process3 1.11 2.43 5.41 1.34 6.32
etc etc
what would be the best way of getting this data from the database? I currently use a massive loop in sql... eg:
SQL > get the process name
SQL > get the answer for year 2002
SQL > get the answer for year 2003
SQL > get the answer for year 2004
etc etc
then move on to the next row (the next process)
as you can see there is an SQL query for EACH row and EACH element of data. I am wondering if there is a better way to do it? The SQL export is taking FOR EVER at the moment as there can be upwards of 500 rows (processes) which need exporting...
I have the following data which I need to export (for example)
process_name 2002 2003 2004 2005 2006
====================================================
process1 1.23 4.32 234.21 221.43 665.32
process2 0.98 0.34 5.32 2.56 7.56
process3 1.11 2.43 5.41 1.34 6.32
etc etc
what would be the best way of getting this data from the database? I currently use a massive loop in sql... eg:
SQL > get the process name
SQL > get the answer for year 2002
SQL > get the answer for year 2003
SQL > get the answer for year 2004
etc etc
then move on to the next row (the next process)
as you can see there is an SQL query for EACH row and EACH element of data. I am wondering if there is a better way to do it? The SQL export is taking FOR EVER at the moment as there can be upwards of 500 rows (processes) which need exporting...