hanahana-sql-script

SAP DBTech JDBC: [328]: invalid name of function or procedure: RECORD_COUNT. I don't understand why an error occurs when using RECORD_COUNT ()



I don't understand why an error occurs when using RECORD_COUNT ().
Do you have a way to assign a record number value to an INT scalar variable?
Here is my code:

 CREATE table tab (COL_A int);
    INSERT INTO tab VALUES (1);
    INSERT INTO tab VALUES (2);

    DO (IN inTab TABLE(col_a int) => TAB, OUT v INT => ?)
     BEGIN
     DECLARE i int;
     v = 0;
     FOR i IN 1 .. RECORD_COUNT(:inTab)
     DO
     v = :v + :inTab.col_a[:i];
    
     END FOR;
    END

ERROR:...SAP DBTech JDBC: [328]: invalid name of function or procedure: RECORD_COUNT...
I am trainning about sap hana, thank you very much for my help and interest in my question.


Solution

  • The RECORD_COUNT SQLScript function is available in SAP HANA 2 and higher. If your HANA system is a HANA 1 system, then this function is not available.