Skip to Content
avatar image
-1
Former Member

Accessing HANA DB procedure via ADBC - Invalid column index (3)

Hi, while calling a DB procedure via ADBC using execute_query, I am getting an exception "Invalid column index (3)" during the method call next_package. any inputs on right direction would be very helpful.

Procedure:

CREATE PROCEDURE "SAPA4H"."MYPROC"( IN ID NVARCHAR(03), OUT OTAB "SAPA4H"."SCARR"))
    LANGUAGE SQLSCRIPT
    SQL SECURITY INVOKER
    READS SQL DATA AS
BEGIN
    OTAB = SELECT MANDT, CARRID, CARRNAME, CURRCODE, URL 
           FROM "SAPA4H"."SCARR" 
           WHERE CARRID = :ID;
END;

Program:

DATA it TYPE STANDARD TABLE OF scarr.
DATA ref TYPE REF TO data.
DATA lv_id TYPE S_CARR_ID VALUE 'AA'.
DATA(lv_stmt) = |CALL "SAPA4H"."MYPROC"('{ lv_id }',NULL) WITH OVERVIEW|.

GET REFERENCE OF it INTO ref.
LO_RES->set_param_table( REF ).
TRY.
  lo_res->next_package( ).
CATCH cx_root INTO lo_exp.
    DATA(LV_TEXT) = LO_EXP->GET_TEXT( ).
ENDTRY.

lv_text = Invalid column index (3)

Thanks, Vikram.M

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 13 at 05:03 AM

    First of all, when posting code please use the little "code" button in the editor. If you cut an paste, use "paste as plain text", and do tidy the code up so it's readable.

    Debug your program, and look at what the value of stmt is, just before you do the execution. This should give you a clue as to what is wrong.

    Add comment
    10|10000 characters needed characters exceeded