IBM Support

Calling a stored DB procedure in OPL

Question & Answer


Question

How can I call a stored procedure in OPL?

Answer

If your stored procedure has parameters, you can call it with DBRead to initialize data:

aSet from DBRead(db,"BEGIN opl_proc_output(:1); END;");

To save data, use DBUpdate:

aSet to DBUpdate(db,"BEGIN opl_proc_input(:1); END;");

If a stored procedure has no parameters, you can call it with DBExecute:

DBExecute(db,"BEGIN opl_proc_noparam; END;");

[{"Product":{"code":"SSSA5P","label":"IBM ILOG CPLEX Optimization Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Features:Database","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.2;12.3;12.4;5.0;5.1;5.2;5.5;5.5.1;6.0;6.0.1;6.1;6.1.1;6.2;6.3","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSSA5P","label":"IBM ILOG CPLEX Optimization Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF017","label":"Mac OS"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"12.5;12.4;12.3;12.2.0.1;12.2","Edition":"All Editions","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

oplstudio/FAQ/212

Document Information

Modified date:
23 June 2018

UID

swg21401523