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

  • SEARCH
  • Home
  • 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 6975643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:23:41+00:00 2026-05-27T17:23:41+00:00

I’m trying to execute a stored procedure in PHP that inserts data into a

  • 0

I’m trying to execute a stored procedure in PHP that inserts data into a table and keep getting the following error message.

oci_execute() [function.oci-execute]: ORA-01843: not a valid month
ORA-06512: at line 1

I’ve ran my insert query by itself, and don’t receive this error. Here is the procedure code.

CREATE OR REPLACE PACKAGE trans_data AS 
  PROCEDURE INSERT_TRANSACTION_INFO(
    var_FName IN TRANSACTION.FIRST_NAME%type, 
    var_LName IN TRANSACTION.LAST_NAME%type, 
    var_DOB IN TRANSACTION.DOB%type, 
    var_InvoiceDate IN TRANSACTION.INVOICE_DATE%type, 
    var_ServiceCode IN TRANSACTION.SERVICE_CODE%type,
    var_BilledAmt IN TRANSACTION.BILLED_AMT%type,
    var_SSN IN TRANSACTION.SSN%type,
    var_ServiceDate IN TRANSACTION.SERVICE_DATE%type,
    var_VendorCode IN TRANSACTION.VENDOR_CODE%type,
    var_TransStatus IN TRANSACTION.TRANS_STATUS%type,
    var_Comp IN TRANSACTION.COMPANY%type,
    var_State IN TRANSACTION.STATE%type,
    var_Return OUT VARCHAR2
  );
END trans_data;

CREATE OR REPLACE PACKAGE BODY trans_data AS 
  PROCEDURE INSERT_TRANSACTION_INFO(
    var_FName IN TRANSACTION.FIRST_NAME%type, 
    var_LName IN TRANSACTION.LAST_NAME%type, 
    var_DOB IN TRANSACTION.DOB%type, 
    var_InvoiceDate IN TRANSACTION.INVOICE_DATE%type, 
    var_ServiceCode IN TRANSACTION.SERVICE_CODE%type,
    var_BilledAmt IN TRANSACTION.BILLED_AMT%type,
    var_SSN IN TRANSACTION.SSN%type,
    var_ServiceDate IN TRANSACTION.SERVICE_DATE%type,
    var_VendorCode IN TRANSACTION.VENDOR_CODE%type,
    var_TransStatus IN TRANSACTION.TRANS_STATUS%type,
    var_Comp IN TRANSACTION.COMPANY%type,
    var_State IN TRANSACTION.STATE%type,
    var_Return OUT VARCHAR2)
  IS
  BEGIN
    INSERT INTO TRANSACTION
      (FIRST_NAME, LAST_NAME, DOB, INVOICE_DATE, SERVICE_CODE, BILLED_AMT, 
        SSN, SERVICE_DATE, VENDOR_CODE, TRANSACTION_ID, TRANS_STATUS, COMPANY, 
        STATE)
    VALUES
      (var_FName, var_LName, to_date(var_DOB, 'MM/DD/YY'), 
        to_date(var_InvoiceDate, 'MM/DD/YY'), var_ServiceCode, var_BilledAmt, 
        var_SSN, to_date(var_ServiceDate, 'MM/DD/YY'), var_VendorCode, 
        SEQ_TRANSACTION_ID.nextval, var_TransStatus, var_Comp, var_State);
    var_return := 'PASS';
  EXCEPTION
  WHEN DUP_VAL_ON_INDEX THEN
    var_return := 'DUPE';
  WHEN OTHERS THEN
    var_return := 'FAIL';
  END INSERT_TRANSACTION_INFO;
END trans_data;

My PHP code receives a POST from the previous page, which I verified all the fields are passing correctly, and binds them to the variables.

//setup insert statement
$stmts = OCI_Parse($c,"BEGIN ucs.trans_data.INSERT_TRANSACTION_INFO(
            :var_FName, :var_LName, :var_DOB, :var_InvoiceDate, :var_ServiceCode, :var_BilledAmt, :var_SSN, 
            :var_ServiceDate, :var_VendorCode, :var_TransStatus, :var_Comp, :var_State, :var_return); END;");

//bind input and output
OCI_Bind_By_Name($stmts, ":var_FName", $FName);
OCI_Bind_By_Name($stmts, ":var_LName", $LName);
OCI_Bind_By_Name($stmts, ":var_DOB", $DOB);
OCI_Bind_By_Name($stmts, ":var_InvoiceDate", $InvoiceDate);
OCI_Bind_By_Name($stmts, ":var_ServiceCode", $ServiceCode);
OCI_Bind_By_Name($stmts, ":var_BilledAmt", $BilledAmt);
OCI_Bind_By_Name($stmts, ":var_SSN", $SSN);
OCI_Bind_By_Name($stmts, ":var_ServiceDate", $ServiceDate);
OCI_Bind_By_Name($stmts, ":var_VendorCode", $VendorCode);
OCI_Bind_By_Name($stmts, ":var_TransStatus", $TransStatus);
OCI_Bind_By_Name($stmts, ":var_Comp", $ComCode);
OCI_Bind_By_Name($stmts, ":var_State", $State);
OCI_Bind_By_Name($stmts, ":var_return", $Return, 4);

//execute statement and add message to Return
oci_execute($stmts);
oci_commit($c);

Any ideas why using a date of 01/01/11 would return this message? Let me know if you need me to post any other information.

  • 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-05-27T17:23:41+00:00Added an answer on May 27, 2026 at 5:23 pm

    You declared wrong types for DATE arguments in your procedure.

    Your procedure uses to_date to parse dates, so each should be passed as VARCHAR. But you declared your arguments as being of type DATE:

    var_DOB IN TRANSACTION.DOB%type, 
    var_InvoiceDate IN TRANSACTION.INVOICE_DATE%type, 
    var_ServiceDate IN TRANSACTION.SERVICE_DATE%type,
    

    Try changing it to:

    var_DOB IN VARCHAR2, 
    var_InvoiceDate IN VARCHAR2, 
    var_ServiceDate IN VARCHAR2,
    

    and see if it works then.

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

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
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
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

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.