From: ornab@amdocs.com (Orna Berlinsky)
Newsgroups: comp.databases.oracle
Subject: calling a PL/SQL procedure from pro cobol using dynamic sql
Date: 1 Jan 2002 08:31:23 -0800
Organization: http://groups.google.com/
Lines: 33
Message-ID: <4e2fb3ee.0201010831.154e01af@posting.google.com>
NNTP-Posting-Host: 212.117.152.149
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1009902683 27214 127.0.0.1 (1 Jan 2002 16:31:23 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 1 Jan 2002 16:31:23 GMT


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

