ResultSet.updateRow() throws SQLException: ORA-00904 - invalid identifier

Dear all,

when trying to update an updatable ResultSet using updateRow() method I retrieve a SQLException: "ORA-00904 - invalid identifier". It is strange, because before updating the row I used an update method like this:

results.updateString (int column, String newValue);

simplified code could look like that:

statement =

connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,

ResultSet.CONCUR_UPDATABLE);

ResultSet results = statement.executeQuery("SELECT LOCATION_ID \"ID\", STATE \"Country\", CITY \"City\", SHRTCT \"Shortcut\" FROM LOCATIONS ");

// I retrieve the ResultSet which is completely OK

.......

int row, column;

String value;

....

// later I call this methods:

results.absolute(row+1);

results.updateString (column+1, value);

results.updateRow();

// when I wanna update e.g. a column "CITY" , method results.updateRow() throws an exception: "SQLException: ORA-00904: "CITY": invalid identifier"

Have it ever happened to anybody? Any advices?

Could SQL aliases be the problem?

Many thanks in advance, Rgds

Miroslav

[1201 byte] By [miroslav.ka] at [2007-11-27 4:01:42]
# 1

I've just check it using SQL query without column aliases and it works... Have anybody an idea how to use column aliases and don't get this error?

i.e.:

"SELECT LOCATION_ID \"ID\", STATE \"Country\", CITY \"City\", SHRTCT \"Shortcut\" FROM LOCATIONS "

- using this query I get ResultSet but I'm unable to update it...

"SELECT LOCATION_ID, STATE , CITY , SHRTCT FROM LOCATIONS "

- it's no problem now, but I don't want to get rid of column aliases!!!!!

Thx for help

miroslav.ka at 2007-7-12 9:06:26 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...