Date format issue in oracle database
Hi,
Back end : Oracle 11.2.0.2.0
Front end : Forms 11g
In our application we are facing issue with TO_DATE('DD/MM/YYY') Date format conversion.
Example: TO_DATE(P_date,'DD/MM/YYYY') giving the result as 20-Dec-0009
In the above eg the Parameter P_date is coming as '20-dec-09' from the front end (forms 11g)
The Nls_date_format parameter at database level is set as 'DD-MON-RR'
Its working fine after changing the conversion as TO_DATE(P_date,'DD/MM/RRRR') .- If we do like this , we need to change in many places , so instead of doing this, is there other solution wrt database settings/Application settings where we can change and fix this issue
pls help us to solve the issue.
Regards.
sathish k
892913 wrote:
Hi,
Back end : Oracle 11.2.0.2.0
Front end : Forms 11g
In our application we are facing issue with TO_DATE('DD/MM/YYY') Date format conversion.
Example: TO_DATE(P_date,'DD/MM/YYYY') giving the result as 20-Dec-0009
In the above eg the Parameter P_date is coming as '20-dec-09' from the front end (forms 11g)
The Nls_date_format parameter at database level is set as 'DD-MON-RR'
Its working fine after changing the conversion as TO_DATE(P_date,'DD/MM/RRRR') .- If we do like this , we need to change in many places , so instead of doing this, is there other solution wrt database settings/Application settings where we can change and fix this issue
pls help us to solve the issue.
Regards.
sathish kWell the solution is right in front of you. As you say, your database environment is set to DD-MON-RR so your database is set to use 2 digit years (something most people moved away from with the millenium bug more than 10 years ago now). You can either change all your code to use RRRR as you've found, or change your database NLS setting to DD-MON-RRRR and change your front end application to pass you a date with 4 digit years so you get e.g. '20-dec-2009'.
So many people worked hard to resolve the millenium bug issues all those years ago, but still we have people, all these years later, who want to reintroduce the problem. So sad.
Similar Messages
-
How to delete data before insert in oracle database
Hi friends,
I have one scenario.I want to send data from sap to Oracle database.Befor i am inserting data in database table,i want to clean/delete all the records in the table .This interface will run twice in a day.Can any body help me.
SAP-PI-JDBC
Thanks
RaviHi Puneet,
As per u r suggestions,i am using stored procedure.But i am getting following error.
Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. MASTERXXXXXX' (structure 'Statement'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'NAME' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)'
I have define below structure.Please check the structure and guide me.
<Statement
Action attribute required
Table
Access
Empname string
Empid string
date date
Type attribute required
EXECUTE----
>Action
Table----
>MASTERXXXXXX
Type----
>char
Please check the above structure andguide me to changes if any requires.
Thanks
Ravi -
How can i convert data from DBF to oracle database 10g?
Sir,
How can i convert data from DBF to oracle database 10g?I assume you at least know how to dump the contents of foxpro dbf file into CSV format.
Regarding SQL*Loader, hope this demo makes it a bit clear to you...
http://www.princeton.edu/~storacle/sqlloader_demo.shtml
I agree that it is an old web page (references Oracle 8.0.5) but basics remain the same.
If it is still unclear to you after referring above link, then get an Oracle consultant. -
HTML Formated Email From Oracle Database
Hello,
I am generating email alerts from oracle 11g,10g using utl_mail.send.
I want to genrate/send email in HTML formated.
How i can send HTML formated email form Oracle Database (11g,10g)
Thanks In Advancehi,
inside oracle apex 10g. i am using this.
please try
begin
HTMLDB_MAIL.SEND(
P_TO => '[email protected]',
P_FROM => '[email protected]',
P_BODY => 'test',
P_BODY_HTML => '<table><tr><td>data</td></tr></table>' || SYSDATE,
P_SUBJ => 'Test Email working '
wwv_flow_mail.push_queue(
P_SMTP_HOSTNAME => 'localhost',
P_SMTP_PORTNO => '25'
end;
Thanks
LOGA
www.go-websoft.com
Apex Consulting & Development -
Load data warehouse from non-Oracle database
Hi
I need to load a data warehouse (in a Oracle database 8.1.6) using Post Gree database tables.
The question is: Oracle Warehouse Builder can identify this database like a source module?
Or is better I generate txt files from Post Gree tables, load a staging database (in Oracle) with the same structure of POst Gree tables and after that, load my data warehouse?
Best Regards
Honorio Cardozo JrYou can identify Oracle sources from Oracle 7.3 and up. I.e. yes, you can directly go against the database and you do not need to extract into flat files.
Mark. -
Hi all,
Has anyone seen the following error please or has a troubleshooting hint: -
"[NT AUTHORITY\SYSTEM (15/10/2012 18:35:12) - Service request cancelled due to an error.
Error Code: 10000
Error Description: Failed to create lease requisition.
Fault code: soap:Server
Fault string: Service Form Field: 'WarningDate2' has Date format issue.
Fault details: REQ_0024Service Form Field: 'WarningDate2' has Date format issue.
CIAC = 3.01
Date and Time format on the CCP, CPO, vmware and SQL servers all Italian (dd/mm/yy)
This only happens when we add a Lease Time on the request.
Do they all have to be set to the US format for this to work?
If this is a regional setting thing, do I have to change the format on all of the servers (CIAC components)?
Cheers
mdThis test program might help...
import java.util.*;
import java.text.*;
public class ExpandYear
public static void main(String[] args) throws ParseException
SimpleDateFormat sdf_2dyear = new SimpleDateFormat("MM/dd/yy");
SimpleDateFormat sdf_4dyear = new SimpleDateFormat("MM/dd/yyyy");
String test1 = "3/21/00";
System.out.println("test1: " + test1 + " to : " +
sdf_4dyear.format(sdf_2dyear.parse(test1)));
String test2 = "4/9/99";
System.out.println("test2: " + test2 + " to : " +
sdf_4dyear.format(sdf_2dyear.parse(test2))); -
How to store and retrieve blob data type in/from oracle database using JSP
how to store and retrieve blob data type in/from oracle database using JSP and not using servlet
thanksJSP? Why?
start here: [http://java.sun.com/developer/onlineTraining/JSPIntro/contents.html] -
How to generate .SQL format file from oracle database?
How to generate .SQL format file from oracle database?
I have a database of Oracle 8.1.6,now want to generate script file (including table structure,index,etc.) from it,What should I do?
Thanks.Your question pertains to the Database Export/Import. This forum exclusively focusses on the export/import utilities that come along with "Oracle Portal" which is a web-based tool. Could you please post your question under the RDBMS export/import or migration forum.
-
Uk date format issue with ASP and Access Database
I have an Asp form which updates records in an Access
database. Problem is
that the date format in the database record is dd/mm/yyyy
(UK), when
the record is displayed on the form it is mm/dd/yyyy(US)
which after I
update the record in the database the date has changed to the
new format.
I have tried everything I can to change the format but to no
avail...anyone any ideas how I can resolve this issue?
Thanks
Stevestevo.s wrote:
> Hi
>
> I have tried changing the format on the date field on
the server behaviours
> panelto ddmmyyy. Also have tried to set the form field
format to ddmmyy. I have
> also tried to use a function I got from a posting
somehwere on the net to no
> avail. <%function ddmmyyyy(varDate)
> ddmmyyyy = Day(DateValue(varDate)) & "/" &
Month(DateValue(varDate))
> & "/" & Year(DateValue(varDate))
> end function
>
> I believe that this is a recognised issue with
Dreamweaver and Access but
> can't seem to grasp the work around! Problem being I am
teaching myself through
> books and internet articles and can be weeks at a time
without being able to
> look at the issue..each time I come back to it it is
like starting all over
> again! I was hoping that somewhere out there there is a
simple solution the
> issue perhaps a date picker with the built in
functionality to address the
> issue...I am keen to understand how to deal with the
issue rather than just
> change my database date field to fudge the problem as I
am in the UK and when I
> eventually start to use the application I would like
there to be some
> consistency with dates and that users are familiar with
the format.
>
> Any help gratefully received!
Its not Dreamweaver, or Access, its your servers locale, its
set to US
format, not the UK.
On your page at the top use:
<% Session.LCID = 2057 %>
This will force the page into using UK formatted dates. Use
it on any
page that needs to format the page correctly.
Dooza
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html -
Date Format issue while Connecting to Oracle8i and Oracle10g
Hi All,
While playing around with JDBC drivers, I came across this weird issue. I have a Local machine with Japanese Locale and I have 2 Database Servers that too with Japanese Locales and Oracle 8i and Oracle 10g each. Now, I connect to these database using JDBC drivers for 8i and perform "select sysdate from dual". Then, m getting dates with 2 different format. While 8i being returning Date with 'DD-MON-RRRR' format, 10g returns date with 'DD-MM_RR' format.
Initially I thought it might be because of some VM Locale thing but when I connected to 10g DB from 8i Oracle client, this behaviour did not changed. Which mean in this case also the date format returned ny the query was different.
Guys F1! F1! (Help! Help!) Appreciate your help to understand this process. Links and suggestions welcome... :)I guess u did not read the whole content. I mentioned this but the difference in behaviour with respect to JDBC drivers made me post this in Java forum.
As I mentioned, it has something to do with the jdbc driver or oracle server itself. Agreed, but what that "something little to do" is the maiin question.
I mentioned that I want to understand this process about how JDBC driver works with Client VM specific Locale settings while interacting with Oracle Database.
Don't you think it could be interesting to know, what it is which brings this difference in results. Its all about clarifying the small bits & pieces which stays unanswered if one overlooks. Its own perception, I felt like asking question, no offense right! -
Error messages when sending date-time stamp to Oracle Database
I have a complex application that communicates with an Oracle database. One of the table values that gets written to the table is a date-time stamp. Until recently, the user only required a date, and this was never an error. (The format String used was %d-%b-%Y) Now they need a time-stamp as well, so I attempted to edit the format string input of the format date/time string function to include the time. I have tried numerous format strings, each of which returns an error on execution. Depending on which format I use, I get one of 3 different error messages. The really odd thing is that both the date and time always get stored in Oracle without any problem (regardless of what date-time I use, as long as I include the date and any part of a time stamp - I get the entire timestamp even if I only include %I for the hour). The only issue is that LabVIEW generates an ODBC error if I try to include the time to the date-time stamp. In other words, teh date/time stamp writes to the Oracle database, but an ODBC error occurs every time. I've included a word doc with screen captures of the format strings used, the resultant date/time stamps written to Oracle and the error messages generated within LabVIEW. Any advice would be most appreciated.
Attachments:
Summary of ODBC Error messages related to date-time stamp.doc 65 KBOracle has a standard date format: 12-Mar-2009 that it accepts as a string, but if you want more than that, you need to use the todate() function. I used this string going into the standard LabVIEW ''Format date/time sting vi'
to_date('%d-%b-%Y %H:%M:%S', 'DD-MON-YYYY HH24:MIS') to create the value needed for Oracle.
Then I use standard format string to create SQL: insert into mytable (mydate) values(%s) and select * from my table where mydate = %s using the string above for %s.
I think you can also define a global format for all time strings but I haven't bothered figuring that out. -
Hi ,
I Have Procedure where it take input parameter date value
for eg
PROCEDURE P_GET_EMP_DATE(V_DATE IN DATE)
IS
V_BEGIN_DATE DATE;
BEGIN
SELECT max(BEGIN_DATE) into V_BEGIN_DATE FROM
emp where TRUNC(APPT_DATE) =V_DATE+90;
END;
now my doubt is APPT_DATE is storing the date format in 12/16/2002
but V_DATE which iam passing to the procedure is in the format
'14-jul-2008' . When i execute the procedure its compiling and executing
successfully.
but when i try to test the single sql manually i get the following error
ORA-00932: inconsistent datatypes: expected DATE got NUMBER .
i know to fix the issue we have to do like this
TO_DATE(TRUNC (APPT_DATE),'YYYY/MM/DD') < = TO_DATE('2007/03/31','YYYY/MM/DD') + 90;
my doubt is how pl/sql engine interpreting the dates and returning the results
though there are errors in the query.does it automatically doing formatting
and type conversions ?You seem to be a bit confused about how to work with Oracle dates...
Basically, we humans represent dates as strings in particular formats: 14th July 2008, 14/07/2008, 07-14-2008, etc.
Oracle stores dates in its own particular format.
In order for us to communicate with Oracle's dates, we either manipulate something that's already stored in the database as a date (eg. sysdate or a date column) OR we use the to_date and to_char functions, which convert a string to an oracle date format and vice versa.
When working with dates in Oracle, you should stick to using the date format. If you're working with things already stored in dates, then great - you've got nothing to worry about conversion wise (and more specifically, never to_date something that's already in the date format!). You only have to worry if you have to specify a particular date as a string - then the to_date function comes into play.
If you're wanting to output a date, you can either rely on your nls_date_format parameter setting (ok for ad-hoc queries, bad for coded queries!!) or you can explicitly state the format you want it to appear in using to_char.
Hopefully that's clarified things for you -
Date Format issue while creating date parameter
While creating date parameter in the crystal reports 2008 with SQL Server 2008 database connection, I want to change the date format according to the specified format in the database.
For ex: YYYY/MM/DD and MM/DD/YYYY
This paramter will be editable in the viewer i.e. I'm going to provide option to the user to change start date and end date for data selection.
Please help!
Thanks in Advance!i found this
i am trying to get the Enter Values screen for parameters to allow entry in a specific format 'DD-MON-RRRR' connecting to an Oracle database. I found that a hack is possible yet I would prefer a clean solution that wont need files changing on client machines. The hack involved changing some javascript files within the Crystal Reports directory. The problem is I now have the date from the calendar in the correct format but it displays the following prompt: Please enter DateTime in format "dd/mm/yyyy hh:mm:ss".
Is there a way to supress this or better yet a way to specify date format without changing the javascript files of Crystal Reports.
I am using Crystal Reports 2008 SP1.
answer---
Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly: -
Multibyte issue in Oracle Database Link
Hi Gurus,
Greetings!!!
I need to transfer data from Microsoft SQL Server 2005 to Oracle DAtabase 10g. I achieved it using Heterogeneous Connectivity. I can now issue queries but unfortunately i got an issue in displaying multibyte characters. I thought of using another Tool that can display multibyte data but it did not help. I even tried setting the initialization parameter HS_LANGUAGE to different characterset but still not able to display. Kindly help and advise how to resolve the said issue.
Many Thanks in Advance,
BenjieHi Kamkan,
My oracle database is configured to support multi language character.
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET AL32UTF8
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 10.2.0.1.0 -
How to extract data from essbase to oracle database incrementally?
I have to extract data from essbase to an oracle database table incrementally using informatica , can anyone tell me how to do it or give me some tips. I have been thinking about it for a whole day but have no ideas.
I cannot do the delete & insert method because this oracle database table is a interface table that has to deliver the data to Oracle ESB tables.
Thanks in advance....Hi,
Have you read through :-
Oracle Data Integrator Adapter for Hyperion Essbase Getting Started - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_getting_started.pdf
Oracle Data Integrator Adapter for Hyperion Essbase User's Guide - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_users.pdf
If you have read them and are still have a problem at what stage are you having the issues?
Cheers
John
http://john-goodwin.blogspot.com/
Maybe you are looking for
-
All of the instructions seem to ask me to start with the firefox window. I cant get this to appear. As an alternate, I have opened Mozilla and clicked on the icon in the upper left corner, but no Options" appears in the drop down menu. (the only item
-
Changing preferred vendor to fixed vendor in SRM PO- no currency conversion
Hi All, We are on SRM_SERVER 550, SP11, ECS scenario. Users create carts where they enter preferred vendor. After approval we found that the PO's were created only in "Held" Status. So we did a conversion of the preferred vendor (PF 39) to Fixed vend
-
G4 and microphone suitable for sound input port
I'm looking into getting started with podcasting and I need help with selecting a microphone. I'm on a G4 desktop machine with a sound input port, any suggestions as to the tech spec or manufacturer of a suitable microphone would be most appreciated.
-
Import error 7.3.4 to 8i urgent
IMP-00017: following statement failed with ORACLE error 1861: "CREATE TABLE "HRM_EMPLOYEE "CONFIRM_DATE" DATE DEFAULT '1900-01-01' NOT NULL, "C" ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 532480 NE" "XT 516096 MINEXTENTS 1 MAXEXT
-
NW 6.5 SP5 server, I have to regenerate the key for tomcat (TCKEYGEN) and restarted TOMCAT and was able to access iManager without problem. However,when I access https://ipaddress:2200, I got message "service temporarily unavailable". Did ADMSRVDN &