Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8999647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:12:28+00:00 2026-06-16T00:12:28+00:00

I’m having a probem executing a Oracle stored procedure through PHP. I’m getting a

  • 0

I’m having a probem executing a Oracle stored procedure through PHP. I’m getting a successful return value, but the procedure is not updating any rows.

Here’s the procedure definition.

CREATE OR REPLACE PACKAGE trans_data AS 
  PROCEDURE UPDATE_TRANS_BY_NAME(
    var_FName IN TRANSACTION.FIRST_NAME%type,
    var_LName IN TRANSACTION.LAST_NAME%type,
    var_DOB IN TRANSACTION.DOB%type,
    var_PolNum IN TRANSACTION.POLICY_NUMBER%type,
    var_TransStatus IN TRANSACTION.TRANS_STATUS%type,
    var_Comp IN TRANSACTION.COMPANY%type,
    var_LineOfBusiness IN TRANSACTION.LINE_OF_BUSINESS%type,
    var_PlanCode IN TRANSACTION.PLAN_CODE%type,
    var_AppDate IN TRANSACTION.APP_DATE%type,
    var_IssueDate IN TRANSACTION.ISSUE_DATE%type,
    var_FaceAmt IN TRANSACTION.FACE_AMT%type,
    var_PolicyStatus IN TRANSACTION.POLICY_STATUS%type,
    var_PaidAmt IN TRANSACTION.PAID_AMT%type,
    var_Return OUT VARCHAR2
  );  
END trans_data;

CREATE OR REPLACE PACKAGE BODY trans_data AS 
  PROCEDURE UPDATE_TRANS_BY_NAME(
    var_FName IN TRANSACTION.FIRST_NAME%type,
    var_LName IN TRANSACTION.LAST_NAME%type,
    var_DOB IN TRANSACTION.DOB%type,
    var_PolNum IN TRANSACTION.POLICY_NUMBER%type,
    var_TransStatus IN TRANSACTION.TRANS_STATUS%type,
    var_Comp IN TRANSACTION.COMPANY%type,
    var_LineOfBusiness IN TRANSACTION.LINE_OF_BUSINESS%type,
    var_PlanCode IN TRANSACTION.PLAN_CODE%type,
    var_AppDate IN TRANSACTION.APP_DATE%type,
    var_IssueDate IN TRANSACTION.ISSUE_DATE%type,
    var_FaceAmt IN TRANSACTION.FACE_AMT%type,
    var_PolicyStatus IN TRANSACTION.POLICY_STATUS%type,
    var_PaidAmt IN TRANSACTION.PAID_AMT%type,
    var_Return OUT VARCHAR2)
  IS
  BEGIN
    UPDATE TRANSACTION
    SET
      POLICY_NUMBER = var_PolNum,
      TRANS_STATUS = var_TransStatus,
      COMPANY = var_Comp,
      LINE_OF_BUSINESS = var_LineOfBusiness,
      PLAN_CODE = var_PlanCode,
      APP_DATE = var_AppDate,
      ISSUE_DATE = var_IssueDate,
      FACE_AMT = var_FaceAmt,
      POLICY_STATUS = var_PolicyStatus,
      PAID_AMT = var_PaidAmt
    WHERE FIRST_NAME = var_FName
      AND LAST_NAME = var_LName
      AND DOB = var_DOB
      AND TRANS_STATUS = 'R'
      AND REASON_FOR_REVIEW = 'No Policy Match';
      commit;
      var_Return := 'PASS';
    EXCEPTION
    WHEN OTHERS THEN
      var_Return := 'FAIL';
  END UPDATE_TRANS_BY_NAME;
END trans_data;

The row updates when I remove line “AND DOB = var_DOB” in the procedure. I’ve tried changing the variable definition to a VARCHAR and using “AND DOB = to_date(var_DOB, ‘DD-MON-YY’)” with no success. I also tried “AND TRUNC(DOB = var_DOB)”, but it also did not work.

Here is the PHP code. I have already verified all of the parameters being passed have values and are formatted correctly for the database datatypes. I stripped out the code that does a previous query that populates some of the bound variables to cut out what is working.

function matchWSPolicy($policy, $trans, $status, $amount){

    include("../includes/DBConn.php");


    if ($Policy == ""){
        $message = 'Policy number does not match!';
        return $message;
    }

    $stmt = OCI_Parse($c,"begin ucs.trans_data.UPDATE_TRANS_BY_NAME(:var_FName, :var_LName, :var_DOB, :var_PolNum, 
        :var_TransStatus, :var_Comp, :var_LineOfBusiness, :var_PlanCode, :var_AppDate, :var_IssueDate, :var_FaceAmt, 
        :var_PolicyStatus, :var_PaidAmt, :var_Return); end;"); 
    OCI_BIND_BY_NAME($stmt,":var_FName",$FName);
    OCI_BIND_BY_NAME($stmt,":var_LName",$LName);
    OCI_BIND_BY_NAME($stmt,":var_DOB",$DOB);
    }
    else {
        $message = 'Policy matched, but a valid SSN or (first name, last name, date of birth) was not returned from the WS database';
}   

    OCI_Bind_By_Name($stmt,":var_PolNum",$Policy);
    OCI_Bind_By_Name($stmt,":var_TransStatus",$status); 
    OCI_Bind_By_Name($stmt,":var_Comp",$ComCode); 
    OCI_Bind_By_Name($stmt,":var_LineOfBusiness",$LineOfBusiness); 
    OCI_Bind_By_Name($stmt,":var_PlanCode",$Plan); 
    OCI_Bind_By_Name($stmt,":var_AppDate",$AppDate); 
    OCI_Bind_By_Name($stmt,":var_IssueDate",$IssueDate); 
    OCI_Bind_By_Name($stmt,":var_FaceAmt",$FaceAmount); 
    OCI_Bind_By_Name($stmt,":var_PolicyStatus",$PolStatus); 
    OCI_Bind_By_Name($stmt,":var_PaidAmt",$amount); 
    OCI_Bind_By_Name($stmt,":var_Return",$return, 4); 

    if ($message == ''){
        oci_execute($stmt);
        oci_commit($c);
    }
    else{
        $message = 'Record not successfully updated.';
    }
    return $message;
}

Any suggestions would be greatly appreciated.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:12:28+00:00Added an answer on June 16, 2026 at 12:12 am

    I know it has been over a year, but I had to come back to this project. The answer was having to convert both values to dates even though the database value was already a date.

    AND to_date(DOB, 'DD-MON-YY') = to_date(var_DOB, 'DD-MON-YY')

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.