Welcome to The Community. The community is designed to share information on SAP HANA in an interactive way.

Visit SAPHANATutorial.Com
HANA Cursor
  • Hi experts,

    Can anyone please help me find what is that i'm doing wrong in my cursor?
    I have a procedure, and i'm using the cursor in it.

    I'm gonna put the code in here so you can check.
    The error that i get is: "SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "FOR": line 88 col 7 (at pos 4338)"

    Many thanks,
    Anita


    -- Cursor

    IF :RECON = 'N' THEN
    BEGIN
    DECLARE CURSOR cCursor FOR
      SELECT "TransId", "CD" FROM #Temp ORDER BY "DataLancamento", "TransId";
      FOR cur_row as cCursor (:TransId, :Value) DO
                   IF :Counter = 0 THEN 
                   BEGIN
                        SaldoAcumulado := :Value;
                   END;
                   IF :Counter <> 0 THEN
                   BEGIN
                        SaldoAcumulado := :SaldoAcumulado + :Value;
                   END;
    UPDATE #Temp SET "SaldoAcumulado" = :SaldoAcumulado WHERE "TransId" = :TransId;
        Counter := :Counter + 1;
      END FOR;
      END;
    END IF;

Howdy, Stranger!

It looks like you're new here. Sign In using your Gmail ID, Click on 'Google' button to sign in

Free Online Training Programs under SAPHANATutorial.com:
Click here to start SAP HANA Basics online course.
© 2016 : saphanatutorial.com, All rights reserved.
Visit SAPHANATutorial.Com