[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::rally

Title:Oracle Rally
Notice:Rally Kits moved from CLT to Wilbry
Moderator:OOTOOL::CRAIG
Created:Fri Mar 23 1990
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2942
Total number of notes:14664

2932.0. "bogus time value inserted into SQL." by M5::JOPPELT (New packaging. Same contents.) Fri Apr 04 1997 22:44

    	RALLY is passing bogus date data in ADLs.
    
    	I got this on 7.0.  Customer saw it on 6.1.
    
    	Create a date global, XXX.
    
    	Create an RMS DSD that has a date field in it.
    
    	Now do the following in ADL:
    
            var id : number;
            status : number;
    begin
    
            xxx := last_day(system_date);
            db_open(date,id,status);
            DATE.DATE1 := xxx;
            db_insert(id,status);
            db_commit(status);
            end;
    
    	In SQL do SELECT * from <table>;
    
    	If run today the value should be:
    
    30-APR-1997 00:00:00.00       
    
    	... and that's what SQL itself inserts.
    
    	But RALLY inserts:
    
    30-APR-1997 00:00:00.32
    
    	Oher times it is .95 or .27, but never .00.
    
    	To work around it do:
    
    	date.date1 := to_date(to_char(xxx,'dd-mon-yyyy'),'dd-mon-yyyy');
    
    	This chops off the time portion of the string.
      
T.RTitleUserPersonal
Name
DateLines
2932.1M5::JOPPELTNew packaging. Same contents.Mon Apr 07 1997 16:153
    	I did a little more playing with this.  It seems that the problem 
    	is coming from the LAST_DAY function, which is documented as
    	returning only the date portion.
2932.2Use TRUNC to remove time componentORAREP::JRFVAX::FREDRICKSONRallyho lads!Thu May 01 1997 12:5016
    >>	To work around it do:
    >>
    >>	date.date1 := to_date(to_char(xxx,'dd-mon-yyyy'),'dd-mon-yyyy');
    >>
    >>	This chops off the time portion of the string.
      
    
    Just as a side note...
    
    A quick way to get the 'last_day' and cut off the time component is:
    
       xxx := last_day (trunc (system_date, 'DDD'));
    
    I does take the time component completely down to zeroes.
    
    Steve