473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Dates, DB/2 and Java

Hi,

I've a question concerning DB/2, dates and Java-binding-Variables:

CASE WHEN MC.fixed_date_dat IS NULL
THEN ? + MC.rel_shift_NR DAY
ELSE MC.fixed_date_dat END

The ? is a binding variable I want to use. If I try to prepare the
statement, I receive a SQL0418N-SQL-error.

Any ideas?

Thanks in advance,
Sascha

Jun 27 '07 #1
2 1451
Sa***************@gmail.com wrote:
Hi,

I've a question concerning DB/2, dates and Java-binding-Variables:

CASE WHEN MC.fixed_date_dat IS NULL
THEN ? + MC.rel_shift_NR DAY
ELSE MC.fixed_date_dat END

The ? is a binding variable I want to use. If I try to prepare the
statement, I receive a SQL0418N-SQL-error.

Any ideas?

Thanks in advance,
Sascha
DB2 doesnt know the type of your parameter. Try

CASE WHEN MC.fixed_date_dat IS NULL
THEN cast(? as date) + MC.rel_shift_NR DAY
ELSE MC.fixed_date_dat END

or whatever type ? is

HTH
/Lennart
Jun 27 '07 #2
CASE WHEN MC.fixed_date_dat IS NULL
THEN cast(? as date) + MC.rel_shift_NR DAY
ELSE MC.fixed_date_dat END
I think this can be written simpler.
COALESCE(MC.fixed_date_dat, cast(? as date) + MC.rel_shift_NR DAY)

Jun 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Firewalker | last post by:
Hey guys, I am newbie to perl. I am trying to deal with dates ( such trying to find what the date would be after month). Is therea function or date class( I am a java programmer, I couldnt find...
11
by: Peter Pfeiffer | last post by:
I've written several scripts that have "while" blocks which increment a date by one day if the date does not match one of a group of dates. However, sometimes it apparently steps out out the while...
5
by: DJ Craig | last post by:
I have written a program that uses the built-in PHP date functions. All that the program does is calculate the amout of time between two dates, or calculate the date a certain amount of time before...
14
by: gorio | last post by:
I have a MySQL/PHP based page with a number of date fields that I would like the user to be able to run a script on to update the fields and then submit them for server processing. All my...
5
by: krishnakant Mane | last post by:
hello all. thanks for the help and for pointing me to the proper url for wxpython related issues. I am so happy that I now have a very easy gui library that can do practically every thing with...
3
by: prashantkuppa | last post by:
hi, iam struggling with difference between two dates of format type dd/mm/yyyy i need difference between two dates olddate(dd/mm/yyyy) - newdate(dd/mm/yyyy) and this should be in java script...
19
by: robtyketto | last post by:
Greetings, I have the following code below which allows the date to be added via a JDBC connection as a STRING. The value of dateString is inserted into the MS ACCESS database. What is the...
2
by: chamarthihari04118 | last post by:
hi i have four text boxes with dates . how to validate these textboxes in java script 1 text box(date) is greter then remaining four dates pls give me the solution
9
by: sha2484 | last post by:
I need help to count days between 2 dates,where i want to count the days between current date and registeration date.Here is the code that i have write but it only compare the days , it do not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.