Troubleshooting
Problem
Load from a remote table using cursors with the WITH UR clause fails with SQL0104n error.
$ db2 "declare myCursor cursor database SQL0104N error received while executing a load command. When doing remote fetch LOAD (LOAD from CURSOR with DATABASE), LOAD sometimes need to rewrite the input SQL (from the DECLARE CURSOR) when fetching the source data, depending on the complexity of the situation. LOAD code does not have a full SQL parser that can fully understand the input SQL. You may use one of these two solutions:
Modified date:
swg21430155
SQL0104N An unexpected token "UR" was found following "
Symptom
Cause
For example:
breaking down the read-only / update / optimize-for / isolation clauses when doing the rewrite of the SQL statement.
In the above example, LOAD detects that the input SQL is not a plain "select * from tablename", and the input/output columns are not direct 1-to-1 mapping, and decides it need to construct the complex version of statement:
WITH db2temporarytableforinternalexportandimportandloadprocessingdonotusethisname (C0, C1, C2, C3, C4) AS ( select * from s5 with ur) SELECT C0, C1, C2, C3 FROM db2temporarytableforinternalexportandimportandloadprocessingdonotusethisname
Unfortunately the above SQL is invalid according to SQL grammar.
The isolation clause with UR is not allowed at that location of the SQL statement.
Thus the SQL0104 error message is returned. Resolving The Problem
OR
Was this topic helpful?
Document Information
16 June 2018
UID