× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Elvis,
After correcting the sql command as follows:
SELECT a.BBPCPK, a.BBPCPKD, a.BBASSIGN,  TIMESTAMPDIFF(2,  timestamp
(DIgits(a.bbcctd) || digits(a.bbcctt)) -                           
timestamp(DIgits(b.bbcctd) ||                                      
digits(b.bbcctt))) diff FROM VOCTRACK a join voctrack b on         
a.bbassign= b.bbassign WHERE a.bbcctd = 20081016 and a.bbcode =    
'STR' and b.bbcode = 'END'                                         
I still get the same error.

Thanks,
 
Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2 
IBM  Certified Specialist- e(logo) server i5Series Technical Solutions Designer V5R3
IBM  Certified Specialist- e(logo)server i5Series Technical Solutions Implementer V5R3
  
 






________________________________
From: Elvis Budimlic <ebudimlic@xxxxxxxxxxxxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Sent: Tuesday, November 18, 2008 1:00:24 PM
Subject: RE: SQL TIMESTAMPDIFF

Click this link:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/db2/rbafzmstscal
e.htm#scatimedifstmp
and search on TIMESTAMPDIFF.

It is supported on V5R3 but you are passing arguments incorrectly.  There is
an example at that link.

HTH, Elvis

Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com


-----Original Message-----
Subject: SQL TIMESTAMPDIFF

According the the V5R3 SQL Reference manual, this built in function should
return the difference between 2 timestamps.  When I attempt to execute a
statement with it, I get the error
Message ID . . . . . . :  
SQL0204                                            
                                                                            
  
                                                                            
  
Message . . . . :   TIMESTAMPDIFF in *LIBL type *N not
found.                 
                                                                            
  
Cause . . . . . :   TIMESTAMPDIFF in *LIBL type *N was not found. If this
is  
  an ALTER TABLE statement and the type is *N, a constraint or partition
was  
  not found. If this is not an ALTER TABLE statement and the type is *N,
a    
  function, procedure, or trigger was not
found.                              
    If a function was not found, TIMESTAMPDIFF is the service program
that    
  contains the function.  The function will not be found unless the
external  
  name and usage name do not match exactly.  Examine the job log for a
message
  that gives more details on which function name is being searched for and
the
  name that did not
match.                                                    
 
The SQL command I am attempting to build is :
SELECT a.BBPCPK, a.BBPCPKD, a.BBASSIGN, TIMESTAMPDIFF(2,           
(DIgits(a.bbcctd) || digits(a.bbcctt)), (DIgits(b.bbcctd) ||       
digits(b.bbcctt))) diff FROM VOCTRACK a join voctrack b on         
a.bbassign= b.bbassign WHERE a.bbcctd = 20081016 and a.bbcode =    
'STR' and b.bbcode = 'END'             

The concatanation of variables for parameter 2 and 3 do result in valid
timestamp values.

Was this BIF introduced later as a PTF?

The system I am using is running V5R3, but is way behind in PTF's.
I have no control over the ordering of PFT's or upgrading to a later
release.

Thanks,
                            
Jeff Young


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.