Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle NVL() Function for Null Values

843854Aug 2 2002 — edited Aug 2 2002
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2002
Added on Aug 2 2002
3 comments
1,059 views