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 7000327
In Process

The Archive Base Latest Questions

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

I am passing in Dates into an Oracle stored procedure. I keep managing to

  • 0

I am passing in Dates into an Oracle stored procedure. I keep managing to get the above exception. That Exception I am guessing is being caused by an incorrect dateTime format on my part. The stored proc requires military time for the dates and is in the Format of 28-Dec-12 11:29:59. The stored proc takes strings and converts them to the right time inside the stored proc… Here is how I set up the correct parameter…

cmd.Parameters.Add(colName[i], DateTime.Parse(trueDateStr).ToString("dd-MMM-yy HH:mm:ss"));

One stored proc parameter that is giving me indigestion is this one…

ACTIVE_DATEIn
to_date(ACTIVE_DATEin,'DD-MON-YY')

The second line is a line a little later on in the stored proc… The first line is the actual parameter that gets passed in. Sometimes that parameter might be null… What I do is I check if it is null, and then I pass in an empty string… Will that empty string cause an error? Should I pass it some kind of Null Date value or empty date value? What is your opinion on that?

  • 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-27T20:39:23+00:00Added an answer on May 27, 2026 at 8:39 pm

    The problem most likely is that you’re passing a string containing date and time while Oracle only expects the date part. That’s exactly what the error message says (after the date part has been successfully parsed there are still characters in the input string but not in the date format):

    ORA-01830: date format picture ends before converting entire input string

    So the fix could be:

    cmd.Parameters.Add(colName[i], DateTime.Parse(trueDateStr).ToString("dd-MMM-yy"));
    

    And passing in an empty string for NULLs is okay. Oracle treats empty strings as NULL and the TO_DATE function handles NULL values just fine.

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

Sidebar

Related Questions

I am passing a parameter into a stored procedure: param = CreateInParameter(Result, DbType.Decimal); param.Value
I am a parsing a file into a sqlite database that contains dates in
I have an ETL process that involves a stored procedure that makes heavy use
I'm passing a date from Ruby to Javascript via JSON. It comes into Javascript
passing post data using cURL requires that the name of the input. However, I
INSERT INTO expense (date,desc,price,out,method) VALUES ('$time','$desc','$price','$out','$method'); What is wrong in the MySQL statement above?
I am passing a string into my song parser method and it is failing
I was passing parameters into a servlet to generate an excel spreadsheet. I then
Taking into consideration performance and readability, how should dates be encoded in JSON for
I am trying to input a date into an Oracle database. Sometime this value

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.