Re: Date Formats

From: Bobby (gadirajuv_at_hotmail.com)
Date: 12/03/04


Date: Fri, 3 Dec 2004 06:45:03 -0800

All:
 thank you very much for the help.
 Actually, I could solve the problem in a different way. There were some
inconsistencies of the way multiple date fields were declared in various
tables of SQL Server. When I populated my temp table, I wrote a script to
change them as uniform fields. Also I changed the formats of the fields in
the Oracle too.
  Also, I had problem in exporting these fields into Oracle. I am a newbie
to SQL Server. I learnt my mistake: I was not passing the parameters in the
same format with that of the fields that were selected in the 'Select'. The
order of the parameters in the update query was different from that of the
order of the fields that were selected in the Source.
I found this problem and could solve it.
Thanks again.
Bobby

"Tibor Karaszi" wrote:

> Bobby,
>
> I presume that the problem is that Oracle doesn't interpret the datetime values from SQL server
> correctly?
>
> The operation "convert(Datetime, Ship_date,101)" is a dummy operation. A datetime value doesn't have
> a format, hence trying to enforce a format for that datatype is meaningless. It is the client that
> interprets the datetime value into a character representation (in this case, the OLEDB provider
> should be the client application). What you want to do is to convert the datetime values into a
> suitable char(n) or varchar(n) datatype so that the format you specified is in the character
> representation and OLEBD/Oracle and perform an implicit datatype conversion from a string into
> datetime (whatever it is called in Oracle).
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "Bobby" <gadirajuv@hotmail.com> wrote in message
> news:2E732F5C-C93E-4754-B760-9D232064FE69@microsoft.com...
> > I'm trying to transfer a table of values from SQL Server to Oracle. I've 3
> > date fields in the table. When transferring the data, I used
> > Select convert(Datetime, Ship_date,101) as ShipDate,
> > convert(Datetime,Last_Tracked_Date,101) as Last_Tracked_date,
> > convert(Datetime,Actual_Delivery_Date,101) as
> > Actual_Delivery_Date
> > from Tablename
> >
> >
> > But I get an error displaying that the null value cannot be inserted into
> > T$LTDT.
> > this field is present in Oracle and corresponds to LastTracked Time.
> > all the records in SQL Server have the value but i am not sure whats wrong.
> > Could someone help me out please??
> > thanks in advance,
> >
> > --
> > Bobby
>
>
>



Relevant Pages

  • Re: convert(datetime, datefld, 101) error
    ... datefld is a varchar field in a sql server 2000 table, ... >already in a SQL Server table? ... >format that is completely unambiguous. ... stored as datetime, ...
    (microsoft.public.sqlserver.programming)
  • Re: UTC dates in SQL 2000
    ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. ... > This db provides dates, which the developer > identifies as UTC, in the format 99999. ... > getutcdatefunction to return the datetime for the> current UTC, or I can CONVERTto convert a> datetime into UTC, but neither will work in an ActiveX> script. ...
    (microsoft.public.sqlserver.dts)
  • Re: Date Formats
    ... I presume that the problem is that Oracle doesn't interpret the datetime values from SQL server ... The operation "convert" is a dummy operation. ...
    (microsoft.public.sqlserver.programming)
  • Re: Real to datetime - how to...?
    ... would like to have it in hh:mm:ss format. ... The division with 24 is necessary, because a datetime value consists ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Oh... no....
    ... select castas datetime) ... Obviously it would be better to use the "standard" format. ... Pro SQL Server 2000 Database Design ... >> data type of the date_variable in stored proc have been set to char ...
    (microsoft.public.sqlserver.programming)