So I changed some things, and I'm doing 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.

I've tried with different combinations of function library qualification
and no luck. I can see the function in System i Navigator. I can also call
the function from STRSQL on the i.

Any ideas?

Thanks...

- Michael


On Tue, Feb 5, 2013 at 9:32 AM, Mike Pavlak <mike.p@xxxxxxxx> wrote:

You might find some pointers here for SQL Stored procedures and PHP at the
free webinar:

http://www.zend.com/en/resources/webinars/i5-os?#STORPROC

Regards,

Mike
Office Phone: (708)233-5880 Cell: (408)679-1011

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On
Behalf Of Michael Ryan
Sent: Tuesday, February 05, 2013 6:06 AM
To: Web Enabling the AS400 / iSeries
Subject: [WEB400] Calling i Function from PHP

I thought I could do this in PHP:

$Wk_Error = MSP_ValidateStoreFN($Wk_Store);

Where MSP_ValidateStoreFN is a function on the i. I'm getting this message
in php.log:

"PHP Fatal error: Call to undefined function MSP_ValidateStoreFN() in
..."

I created the function with the Create Function SQL statement on the i.

Is this syntax not available, and I need to use db2_exec or db2_execute?

I believe I could use this function like this:
"Select * from StrMaster where MSP_ValidateStoreFN($Wk_Store) = 'Y';"
Is that correct?

Thanks!
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list To post a message email: WEB400@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.