calling a PL/SQL procedure from pro cobol using dynamic sql

From: Orna Berlinsky <ornab_at_amdocs.com>
Date: 1 Jan 2002 08:31:23 -0800
Message-ID: <4e2fb3ee.0201010831.154e01af_at_posting.google.com>


Hi,

I need to call a procedure from pro cobol. this procedure have an input parameter of a table_name and it truncates the table.
It works fine when I hard code the table name into the dynamic string :

           MOVE "begin TRUNCATE_TABLE('AAA'); end;"
           TO SQ01-DYNSTMT-ARR

           COMPUTE WS02-SQL-LENGTH =
                   FUNCTION LENGTH(SQ01-DYNSTMT-ARR).

           MOVE WS02-SQL-LENGTH TO SQ01-DYNSTMT-LEN.

           EXEC SQL PREPARE S FROM :SQ01-DYNSTMT END-EXEC.
           
           EXEC SQL EXECUTE S END-EXEC.


But I cannot make it work when I try to make the table name and input parameter and use a constant.
how exactly do I define the host variable in the declare section ? How do I populate it with the input value ? how do I define the host variable ?

I will appreciate it if you can add to my lines above what I need to define in addition, to be able to do it

thanks !!!
Orna Received on Tue Jan 01 2002 - 17:31:23 CET

Original text of this message