Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
CURRENT DATE functionality dynamically(CURRENT DATE - : var)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: CURRENT DATE functionality dynamically(CURRENT DATE - : var)
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: 6970
Location: porcelain throne

PostPosted: Wed Apr 11, 2012 6:38 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts ICETOOL - RESIZE DYNAMICALLY kranthikumarb DFSORT/ICETOOL 0 Tue Nov 21, 2017 5:30 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us