SQL Server The column name is not valid
Normally I'd ask this question on the Micosoft answers forum, but since they now want me to download the Microsoft Authenticator app to my phone, I'm not interested. LQ people seem to know stuff like this so I'll try here.
I'm running Slackware64 14.2, Java 17.0.2 and Tomcat10.0.17. I'm running a query in java/jsp which is giving me an error: Code:
select a.allocationAmount, c.totalCredit Code:
select a.allocationAmount, c.totalCredit |
Did you paste the same code twice? Even so, these might be two different databases, only one of them having this field.
|
I am with NevemTeve, I see 2 select queries and no java / jsp??
|
Instinctively, I'd suggest that you look for "a 'DOH!' :doh: situation" right about now. Check very carefully that you are in fact presenting an identical query, to the same database, in both (very different ...) situations.
|
sundialsvcs was right, "a 'DOH!' :doh: situation". I have two ResultSet variables in my program, and this query used the 2nd one, rs2. However, when I went to get the column totalCredit I did rs.getBigDecimal("totalCredit") instead of rs2.getBigDecimal(...). Posting the actual code would probably have helped everyone see my error, but I've become gun-shy of posting code on LQ as I often get such posts rejected.
Anyway, thanks all for the help. |
("Chuckle ...") Good sir, by now my forehead is perfectly smooth as the result of such physical encounters.
- - - Shhh!! Don't let them know! They still believe that we are all geniuses! ;) |
All times are GMT -5. The time now is 10:41 PM. |