IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CURRENT DATE functionality dynamically(CURRENT DATE - : var)


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bijeshch

New User


Joined: 23 Apr 2010
Posts: 3
Location: USA

PostPosted: Wed Apr 11, 2012 5:24 am
Reply with quote

Hi,

I am trying to use the CURRENT DATE functionality dynamically as,

"CURRENT DATE - : variable DAYS " in my query. I am getting compatibility issues.

I tried by giving
a) variable declaration as 9 (03) comp-3 but is getting compilation error.
b) variable declaration as X (10) since current date is returning a 8 byte field but is getting bind error.

Again I tried the query as "CURRENT DATE - DAYS (:variable) " as argument to the scalar function, but was not able to get through the bind errors.

The query works when "CURRENT DATE - 99 DAYS " is given. So I think its an issue with the host variable.

The SQl return code is -171 THE DATA TYPE, LENGTH, OR VALUE OF ARGUMENT nn OF function-name IS INVALID.

Please help me with this.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 11, 2012 6:38 am
Reply with quote

you are invited to see for yourself,
what kind of host variables are used in
Datetime arithmetic
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Changeman - how can we know the curr... Compuware & Other Tools 2
Search our Forums:

Back to Top