Call i Function from PHP

General discussion on Zend Server for IBM System i

Call i Function from PHP

Postby michaelryan on Tue Feb 05, 2013 5:54 pm

I want to use a function on the i for validation in my PHP program. I'm trying this:

$SQLStmt = "SELECT * from sysibm.sysdummy1 where NEWSYS.MSP_ValidateInvoiceTypeFN($Wk_Store) = 1";
$stmt = db2_exec($db2connection, $SQLStmt) or die("Failed SQL Stmt:".$SQLStmt.":".db2_stmt_error().":".db2_stmt_errormsg());

and I get a 'statement failed' in php.log.

I get this: MSP_VALIDATEINVOICETYPEFN in NEWSYS type *N not found. SQLCODE=-204 in db2errormsg.

This function (MSP_VALIDATEINVOICETYPEFN) is a procedure in service program MSPSRVPGM.

I can see the function in System i Navigator. I can call the function from an RPG program using embedded SQL.

I'd rather not use a stored procedure (rather not have to prepare, param, etc.) for a simple validation.

What am I doing wrong?

Thanks!
michaelryan
 
Posts: 11
Joined: Tue Feb 05, 2013 5:46 pm

Return to Zend Server for IBM i

Who is online

Users browsing this forum: No registered users and 5 guests