Date as Parameter
I am trying to send a Date as a parameter to a stored procedure (Oracle) and I can not figure out how to send it. I have a simple context variable with the value, 2012-01-01 08:00:00.000. I keep getting an error, ORA-01861: literal does not match format string ORA-06512" No matter what format I try, I keep getting that error or the, "ORA-01843: not a valid month ORA-06512" error.
What format does a date need to be in?
-
When we execute a insert query to insert any date format in the Oracle Database then we have to use the TO_DATE() function and the same thing applies to stored procedure also. Adeptia’s Stored Procedure activity executes a stored procedure i.e. created in database itself. Therefore it is mandatory to provide a TO_DATE() function that will allow any date format to be passed in the stored procedure.
However, you can also take care of this in Adeptia by using function Current-date('EEEE MM/dd/yyyy hh:mm a') in Data Mapper which returns a value like MONDAY 07/31/2006 11:55 AM
0 -
Yes, it works. When using adeptia, it was a better solution to use a character type parameter in the stored procedure, since we are wanting to send a date as a string anyways. I was able to format the date in the data mapper and send it to the stored procedure. The stored procedure uses the TO_DATE() function as it needs to.
0
Post is closed for comments.
Comments
2 comments