Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Error in procedure

Hi,

I am going through procedure from SAP help document.

I still not understand from where can I refer the correct syntax for creating a procedure.

Below is the code I directly copied form SAP help procedure but throwing below error.

Kindly note that Control_tab table already exists in schema Sumeet.

If i give like "Sumeet"."control_tab" it throws error "ID" column doesnt exists , which exists in the table control_tab.

CREATE PROCEDURE orchestrationProc( )

LANGUAGE SQLSCRIPT AS

BEGIN

   DECLARE v_id BIGINT;

   DECLARE v_name VARCHAR(30);

   DECLARE  v_pmnt BIGINT;

   DECLARE v_msg VARCHAR(200);

   DECLARE CURSOR c_cursor1 (p_payment BIGINT) FOR

     SELECT id, name, payment FROM control_tab

       WHERE payment > :p_payment ORDER BY id ASC;

   CALL init_proc();

   OPEN c_cursor1(250000);

   FETCH c_cursor1 INTO v_id, v_name, v_pmnt; v_msg := :v_name || ' (id ' || :v_id || ') earns ' || :v_pmnt || ' $.';

   CALL ins_msg_proc(:v_msg);

   CLOSE c_cursor1;

END;

Error:

Could not execute 'CREATE PROCEDURE orchestrationProc( ) LANGUAGE SQLSCRIPT AS BEGIN DECLARE v_id BIGINT; DECLARE ...' in 6 ms 740 µs .

SAP DBTech JDBC: [259] (at 267): invalid table name:  Could not find table/view CONTROL_TAB in schema Sumeet: line 9 col 36 (at pos 267)

BR

Sumeet

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question