Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Using PHP to access AS/400 with Stored Procedures

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using PHP to access AS/400 with Stored Procedures

    I am having a difficult time figuring out how to get a result set from an as/400 stored procedure. Using PHP, I can connect to the as/400 fine and access the database, but I cannot figure out the syntax for using stored procedures. Is it even possible? I created a stored procedure that returns a result set and put it in my library. We tested the stored procedure using ops nav it works fine. Then I unsuccessfully experimented with PHP using the odbc_exec function as follows (passes in a numeric and alpha parm): $query = "call MYLIBRARY.TESTSTORED(01,'AA')"; $x = odbc_exec($db, $query); Any clues or examples would be GREATLY appreciated. Especially books with examples would be so helpful. Thanks a lot.

  • #2
    Using PHP to access AS/400 with Stored Procedures

    I finally figured this out ... at least some of it. The reason standard php odbc calls didn't communicate to my as400 stored procedure was because our stored procedure had an sql return code (an INOUT parm) in a 5 byte alphpa parm. When I removed that INOUT parm, It worked. The stored procedure also had 2 input parms and I was able to pass data to those with no problem. Just that INOUT parm gave me problems. I picked up PHP quickly and foresee this as a productive language.

    Comment

    Working...
    X