Is it possible to call an RPG LE program from SQL trigger procedure? Sample of SQL trigger: Create trigger sampledb01.branch_in...
before insert on sampledb01.branch referencing new row as n for each row mode DB2row call sampledb01.brnch('i', n.branch_no, n.branch_name,n.branch_mgr, n.zone_no,n.region_no,n.status,n.telephone,n.address,n.enablers );
However, I get a message SQL0204 BRNCH in SAMPLEDB01 type *n not found.
The code above lifted from SG24-6503-01 Stored Procedures, Triggers and User Defined Functions.
Absolutely, you can call an RPGLE program from an SQL trigger. However, the RPG program must be registered as an external stored procedure with the CREATE PROCEDURE statement before creating the trigger. There are several examples of external stored procedures in the Redbook that you reference.
MORE INFORMATION ON THIS TOPIC
Visit the ITKnowledge Exchange and get answers to your DB2 questions fast.
Check out this Search400.com Featured Topic: Expert advice on DB2
Search400.com's targeted search engine: Get relevant information on DB2/400.
The Best Web Links: Tips, tutorials and more.
Dig Deeper on iSeries SQL commands and statements
Related Q&A from Kent Milligan
To solve the SQL error -321 on IBM i6.1, use the new values statement to overcome the error. If you are using an older release, declare a cursor ... Continue Reading
When working with DB2 files with columns that have both short and long names, there is no option choose which column names are returned via ODBC ... Continue Reading
When developing tables in a parent-child relationship, use a primary key and a foreign key along with a unique ID to make your database easier to ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.