Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Running a Function from within a Package - Oracle

    Hi,

    I would like to pull out Information from a table in oracle. Within this data will be several ID's.

    I would like to then pass these ID's one by one into functions within a package to pull out more data.

    Has anyone done this before or can provide help or code?

    I'm unsure how to call the function after selecting the data....

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The initial select will be a stored procedure - I can't find how to call that in PHP....

    Then pull the ID out of the stored procedure to call the functions in the package....

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have wrote my oracle stored procedure and it works fine...

    I just need to be able to call it and return its results in php and then call a function in a package....


    here is my code - I'm having a few probs

    PHP Code:
    <?php
    $conn 
    OCILogon("user","pass","db");
    $stmt OCIParse($conn,"begin sp_customerdata(2,'UK'); end;"); 

    OCIExecute($stmt);

    while (
    OCIFetchInto($stmt, &$arrCustomerOCI_ASSOC+OCI_RETURN_NULLS))

          {

        
    ?>
            <tr> 
              <td>
              <?= $arrCustomer['Customer_ID'?>
              </td>
              <td>
    <?= $arrCustomer['Start_Date'?>
     </td>
              <td>
              <?= $arrCustomer['End_Date'?>
     </td>
            </tr>

    <?php }
    OCIFreeStatement($stmt);
    OCILogoff($conn);
    ?>
          </table>
    I get this error:

    Warning: ocifetchinto(): OCIFetchInto: ORA-24374: define not done before fetch or execute and fetch

    on this line:

    while (OCIFetchInto($stmt, &$arrCustomer, OCI_ASSOC+OCI_RETURN_NULLS))

    Any ideas?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •