{"record":{"id":"4fc836c06d750bdb","repo":"prestodb/presto","slug":"movetocurrentrow","errorCode":null,"errorMessage":"moveToCurrentRow","messagePattern":"moveToCurrentRow","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1082,"sourceCode":"    @Override\n    public void cancelRowUpdates()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"cancelRowUpdates\");\n    }\n\n    @Override\n    public void moveToInsertRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"moveToInsertRow\");\n    }\n\n    @Override\n    public void moveToCurrentRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"moveToCurrentRow\");\n    }\n\n    @Override\n    public Statement getStatement()\n    {\n        return statement;\n    }\n\n    @Override\n    public Object getObject(int columnIndex, Map<String, Class<?>> map)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getObject\");\n    }\n\n    @Override\n    public Ref getRef(int columnIndex)\n            throws SQLException","sourceCodeStart":1064,"sourceCodeEnd":1100,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1064-L1100","documentation":"moveToCurrentRow() returns the cursor from the insert row back to the current row and requires updatable-result-set support. Presto's PrestoResultSet always throws SQLFeatureNotSupportedException(\"moveToCurrentRow\").","triggerScenarios":"Calling moveToCurrentRow() on a PrestoResultSet, typically as cleanup after moveToInsertRow()-based insert attempts (which themselves fail first).","commonSituations":"Cleanup/finally blocks in cursor-insert code ported from other databases; generic JDBC frameworks that unconditionally restore cursor position.","solutions":["Remove moveToInsertRow/moveToCurrentRow usage entirely; on Presto the cursor never leaves the current row","Route all inserts through SQL INSERT statements","Place such calls behind a concurrency/type capability check"],"exampleFix":"// before\nrs.moveToInsertRow();\n// ... updates ...\nrs.insertRow();\nrs.moveToCurrentRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\n        \"INSERT INTO orders (name) VALUES (?)\")) {\n    ps.setString(1, name);\n    ps.executeUpdate();\n}\n// cursor position is unaffected by SQL inserts","handlingStrategy":"validation","validationCode":"if (rs.getConcurrency() != ResultSet.CONCUR_UPDATABLE) {\n    // cursor never left the current row; no need for moveToCurrentRow()\n}","typeGuard":null,"tryCatchPattern":"try {\n    rs.moveToCurrentRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // no-op on Presto: cursor is always on the current row\n}","preventionTips":["Remove insert-row navigation pairs (moveToInsertRow/moveToCurrentRow) when porting to Presto","Do not wrap Presto result sets with updatable-resultset helpers","Read data only; write through SQL statements"],"tags":["jdbc","presto","unsupported-feature","sqlfeaturenotsupported"],"backgroundTag":"unsupported-jdbc-feature","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}