Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

native SQL

Former Member
0 Likes
367

Hi all , I have problem run time eror in code


   OPEN dbcur1 FOR
      SELECT * FROM zbakt
      WHERE  indic IN ('P', 'A', 'B', 'K', 'T')
      AND    rownum <= :brred
      ORDER BY PRIMARY KEY
  ENDEXEC.
  DO.
    EXEC SQL.
      FETCH NEXT FROM dbcur1 INTO :itzbakt
    ENDEXEC.
    IF sy-subrc <> 0.
      EXIT.
    ELSE.
      APPEND itzbakt.
    ENDIF.
  ENDDO.
  EXEC SQL.
    CLOSE dbcur
  ENDEXEC.

on FETCH NEXT statement run time error aper

but in other programs same statement is OK.

Any sugsest?

2 REPLIES 2
Read only

rainer_hbenthal
Active Contributor
0 Likes
333

Other system might have a different DBMS.

Read only

Former Member
0 Likes
333

you can not declare

ORDER BY PRIMARY KEY / must be fields from table

solved!!!