Document Type | Troubleshooting
Category | App Development
Applicable Product Version | 7FS02PS
Document Number | TDETS019
Issue
When performing a top n query, the error code TBR-8006: Missing FROM keyword. is displayed, and the query does not execute.
Reproduction Scenario
SQL> create table t149894 (a number); SQL> insert into t149894 values(1); SQL> insert into t149894 values(2); SQL> insert into t149894 values(3); SQL> commit; SQL> select top 2 a from t149894; TBR-8006: Missing FROM keyword. at line 1, column 12 of null: select top 2 a from t149894
Cause
The patch โFS02PS_149894lโ which added the top n syntax to limit the number of rows output during Select was not applied to this binary, so the top n syntax is not supported, causing this error.
Solutions
Apply the patch to resolve the issue. (Applied patch: 149894l )
CautionApply the patch through technical support provided by Tmax TIBERO.
To execute top-N queries, the binary must have patch 149894 applied.
Verify normal operation after applying the patch.
SQL> select top 2 a from t149894;
A
1
2
2 rows selected.NoteAs a temporary workaround, you can modify the query as follows.SQL> select a from t149894 order by a offset 0 rows fetch next 2 rows only; A 1 2 2 rows selected.[ OFFSET offset { ROW | ROWS } ][ FETCH { FIRST | NEXT } [ { rowcount | percent PERCENT } ]{ ROW | ROWS } { ONLY | WITH TIES } ]
OFFSET N: Specifies the number of rows to skip.
FETCH: Specifies the number or percentage of rows to return.
ONLY: Returns only the specified number or percentage of rows.
WITH TIES: Includes ties for the last row returned.