Topic
  • 4 replies
  • Latest Post - ‏2012-06-12T14:58:22Z by krmilligan
dgayte
dgayte
3 Posts

Pinned topic Omnifind Stored procedure SEARCH with PHP

‏2012-06-07T14:11:45Z |
Hello,
We are in V7.1 of OS/400 and we use the product OmniFind. Everything works fine when calling stored procedures with iSeries Navigator.
But we want to call Omnifind stored procedures from our PHP web application to our OS/400. Everything works fine except the procedure SEARCH. Indeed, with PHP, though we come to retrieve result sets (as the procedure QUERY_OBJECT_SET;) but not that of SEARCH. When we pass it three parameters, I have the right number of results returned in the OUT parameter. But my result set is empty ... Are you aware of the problem or solution to fix this?
Thank you in advance
Updated on 2012-06-12T14:58:22Z at 2012-06-12T14:58:22Z by krmilligan
  • krmilligan
    krmilligan
    450 Posts

    Re: Omnifind Stored procedure SEARCH with PHP

    ‏2012-06-07T15:40:22Z  
    Did you try explicitly qualifying the SEARCH procedure with the correct schema name on the CALL?
  • dgayte
    dgayte
    3 Posts

    Re: Omnifind Stored procedure SEARCH with PHP

    ‏2012-06-07T15:53:27Z  
    Did you try explicitly qualifying the SEARCH procedure with the correct schema name on the CALL?
    Thanks for your time.
    So yes, I checked the syntax and it's the same syntax (syntax and the good schema) who works fine with Iseries Navigator.
    I run the stored procedure with the same USRPRF (with PHP or with Iseries Navigator)
  • dgayte
    dgayte
    3 Posts

    Re: Omnifind Stored procedure SEARCH with PHP

    ‏2012-06-11T12:03:54Z  
    • dgayte
    • ‏2012-06-07T15:53:27Z
    Thanks for your time.
    So yes, I checked the syntax and it's the same syntax (syntax and the good schema) who works fine with Iseries Navigator.
    I run the stored procedure with the same USRPRF (with PHP or with Iseries Navigator)
    Hi,

    I search this week end a solution for my problem and I think the problem is about XML column.
    So I paste a code part (PHP) to retrieve the result set.

    $cpro = db2_prepare($cnx,"CALL TEST_OMNI.SEARCH( ? , ? ) ");
    $BIB="PHPSPL_IDX";
    $SEARCH="ANANAS";
    db2_bind_param($cpro, 1, 'BIB', DB2_PARAM_IN);
    db2_bind_param($cpro, 2, 'SEARCH', DB2_PARAM_IN);
    if (db2_execute($cpro)) {
    while ($row = db2_fetch_object($cpro)) {
    echo "{$row[0]}, {$row[1]}, {$row[2]}, {$row[3]}
    ";
    }
    }else {
    echo "ERR";
    }

    The code is ok but it's impossible to exploit the result set when a XML column is present in result set...

    Any idea ?

    Thanks a lot !
  • krmilligan
    krmilligan
    450 Posts

    Re: Omnifind Stored procedure SEARCH with PHP

    ‏2012-06-12T14:58:22Z  
    • dgayte
    • ‏2012-06-11T12:03:54Z
    Hi,

    I search this week end a solution for my problem and I think the problem is about XML column.
    So I paste a code part (PHP) to retrieve the result set.

    $cpro = db2_prepare($cnx,"CALL TEST_OMNI.SEARCH( ? , ? ) ");
    $BIB="PHPSPL_IDX";
    $SEARCH="ANANAS";
    db2_bind_param($cpro, 1, 'BIB', DB2_PARAM_IN);
    db2_bind_param($cpro, 2, 'SEARCH', DB2_PARAM_IN);
    if (db2_execute($cpro)) {
    while ($row = db2_fetch_object($cpro)) {
    echo "{$row[0]}, {$row[1]}, {$row[2]}, {$row[3]}
    ";
    }
    }else {
    echo "ERR";
    }

    The code is ok but it's impossible to exploit the result set when a XML column is present in result set...

    Any idea ?

    Thanks a lot !
    Sounds like you're probably hitting a defect. You should contact IBM Support.