SAP Knowledge Base Article - Preview

3211859 - sql syntax error: incorrect syntax near "WITH"

Symptom

Run an ABAP program, get the following error messages:

SQL ERROR  :
  SQLCODE  : 257
  SQLSTATE : HY000
  MESSAGE  : sql syntax error: incorrect syntax near "WITH": line 1 col 38 (at pos 38)

1) Enable and collect SQLDBC Trace (KBA 1993251)

2) search the key word "incorrect syntax near" in the trace files, get the following SQL statement:

>Statement::sendSQL (2022-05-09 12:38:06.424699)
sql= select * from #PAL_METRIC_STATS ;   WITH RANGE_RESTRICTION('CURRENT')
flags=8722
>Connection::getRequestPacket (2022-05-09 12:38:06.424701)


Read more...

Environment

  • SAP HANA, platform edition 1.0
  • SAP HANA, platform edition 2.0

Keywords

syntax error; near "WITH"; Data Aging; RANGE_RESTRICTION('CURRENT') , KBA , HAN-DB , SAP HANA Database , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.