In my project I have a query like this:
query= "SELECT ID_STEZ, B.ID_PAR, B.VALORE WHERE
A.ID_STEZ = B.ID_STEZ AND B.ID_PAR = C.ID_PAR(+) AND A.ID_RET =
D.ID_RET AND A.ID_STEZ IN " +
stuz + " AND B.ID_PAR IN " + clim + " AND C.ID_PAR = B.ID_PAR"
which is perfectly working.
The variable stuz is like this : (12,45,64,85,127,476)
The variable clim is like this : (122,5,164,45,27,46)
The result of the query at the moment is stored in a TreeMap.
The problem is that if there is no data for clim (let's say) 5
i have not the column for clim 5
ResultSet rset = stmt.executeQuery (query);
result.setNumCols(rset.getMetaData().getColumnCount());
... and the getColumnCount() don't consider the clim "5"
but I need a column for clim 5 as I have to fill the column
with "nodata" when I publish the web page !!!
How to solve it ????
Thomas Kellerer - 11 Sep 2007 09:26 GMT
pincopallo_it@yahoo.it, 11.09.2007 10:17:
> In my project I have a query like this:
>
[quoted text clipped - 4 lines]
>
> which is perfectly working.
No it's not.
The above is not a valid SQL Statement (the FROM part is missing).
> The variable stuz is like this : (12,45,64,85,127,476)
> The variable clim is like this : (122,5,164,45,27,46)
[quoted text clipped - 9 lines]
> but I need a column for clim 5 as I have to fill the column
> with "nodata" when I publish the web page !!!
Your SELECT only has three columns (id_stez, id_par and valore) so you
will never get more columns.
If there is a row (!) with id_par = 5 (that's your "clim 5") then you'll
get more rows, not more columns.
Thomas