I am getting errors with some code that executes a NVL() function to avoid displaying the word "Null" for Oracle. The SQL looks much like this:
SELECT NVL(name, ' ') FROM providers WHERE provnumber ='12345678'
I am able to get a ResultSet so the SQL code is OK but I get errors in the following:
while (rs.next()) {
System.out.println(rs.getString("name")); //error occurs here
}
The reported error is "java.sql.SQLException: Invalid Column Name" but I am certain that this is the correct column name. If I remove the NVL function and just use SELECT name FROM ... it works fine. Any suggestions?
Thanks
Zac