473,770 Members | 4,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 Universal JDBC Driver and {fn CURDATE()}

Hi,

My apologies in advance if my terminology is slightly confused, I am
new to all this.

We have previously been running some SQL on DB2 (v7) utilising a type 3
driver, and have made the change to DB2 v8 with a type 2 DB2 Universal
JDBC Driver.
SQL that ran successfully under the old setup now throws the following
error...

(Simplified) SQL:
'SELECT * FROM OURTABLE WHERE EFF_FROM_DT <= {fn CURDATE()} AND
EFF_UNTL_DT >= {fn CURDATE()}'

Error:
SQL0007N The character "{" following ") AND EFF_FROM_DT <=" is not
valid

I have read all I can see on the IBM help page and can't find any
reference to changes to embedded SQL support in either v8 or as a
result of the JDBC driver change.

Many thanks for any help,
Charl

Nov 12 '05 #1
2 4472
charl wrote:
Hi,

My apologies in advance if my terminology is slightly confused, I am
new to all this.

We have previously been running some SQL on DB2 (v7) utilising a type 3
driver, and have made the change to DB2 v8 with a type 2 DB2 Universal
JDBC Driver.
SQL that ran successfully under the old setup now throws the following
error...

(Simplified) SQL:
'SELECT * FROM OURTABLE WHERE EFF_FROM_DT <= {fn CURDATE()} AND
EFF_UNTL_DT >= {fn CURDATE()}'

Error:
SQL0007N The character "{" following ") AND EFF_FROM_DT <=" is not
valid

I have read all I can see on the IBM help page and can't find any
reference to changes to embedded SQL support in either v8 or as a
result of the JDBC driver change.

Many thanks for any help,
Charl
The {..} notation is client specific. Apparently the Type 2 driver
doesn't know what it means.
Is theer anything preventing you from using regular SQL?

SELECT * FROM OURTABLE WHERE EFF_FROM_DT <= CURRENT DATE AND EFF_UNTL_DT >= CURRENT DATE


If you want the function CURDATE that can also be easily done:

CREATE FUNCTION CURRDATE()
RETURNS DATE CONTAINS SQL NON DETERMINISTIC NO EXTERNAL ACTION
RETURN CURRENT DATE

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
a-ha!
that's related to the 'Ability to call uncatalogued stored procedures'
bit in here
(http://publib.boulder.ibm.com/infoce...rjvjcdif.htm)?
many thanks,
charl

Nov 12 '05 #3

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

Similar topics

0
1880
by: Priya | last post by:
Hi, I am having some problem with DB2 Universal JDBC driver. 1. The method getColumnType(columnNumber)of ResultSetMetaData always returns zero. 2. The method getColumnDisplaySize(ColumnNum) raises an exception, with exception message - not supported. Version of DB2 - 7.1
4
6348
by: Dani | last post by:
Hi everyone Description of the problem: Using a PreparedStatement to write down an integer (int) plus a timestamp for testing purposes. When read out again the integer looks very different. We found that it was shifted three Bytes to the left, i.e. 4 becomes hex 4000000 which is 67108864 in decimal base. This means that the value written and the value read sometimes do not match, which is of course inacceptable for all real world...
0
3083
by: Bing | last post by:
Hi, I am configuring the same DB2 v8.1 JDBC universal driver (db2jcc.jar and db2jcc_license_cisuz.jar) from DB2 SP5 fix pack under WSAD 5.1.x environment and WebSphere application Server 5.0.2 on Windows 2000 machines. I configured a connection pool data source using type 4 for a local test environment in WSAD 5.1.x, and a connection pool data source on the WebSphere Server too. Both data sources are accessing the same database.
2
3761
by: Raquel | last post by:
Read this about the Universal JDBC Driver.... "In a Type 2 mode, the Universal JDBC driver provides local application performance gains (because it avoids using TCP/IP protocol to communicate to the DB2 server). " Wht does it mean by "local" application performance? In type 2 mode, it is a pre-requisite that all the databases that the application running at the client need to be cataloged (through CCA or otherwise) on the client; Most...
0
2940
by: aj | last post by:
DB2 v8 FP5 Red Hat AS/EL 2.1 I am specifying properties for a DB2 Universal JDBC Driver connection in my Java/JDBC app by creating a java.util.Properties object and passing it along in my connect() call.. For example, I use the "currentSchema" property to set the default schema, which is apparently equivalent to a "SET SCHEMA" command on the connection.
1
13213
by: sbanil | last post by:
We have a JAVA application which uses following Database product name : DB2 Database product version : DSN07012 JDBC driver name : IBM DB2 JDBC Universal Driver Architecture JDBC driver version : 2.3.63 APplication Server:Websphere When the prepared statement cache for the JDBC driver is set to > 0 following query fails on DB2 OS/390 version but doesn't fail on the UDB version on Windows. Any ideas. Error:
1
1891
by: dunleav1 | last post by:
Does anyone know the link of IBM's web site for the Universal JDBC driver for DB2? I just can't find it. Thanks, JD
0
1408
by: dunleav1 | last post by:
How can I be sure that DB2_LINUXAIO is working properly in DB 9 FP3? The parameter db2_linuxaio was depreciated from the base version to FP3 and my performance tests have shown a decrease in performance between the versions. DB2 9 FP3 on windows compared to windows seems to be about 40% faster in my first test. I have a few more to run... DB's are configured that same in Windows and Linux. My tests connect via jdbc and use the Db2...
0
1946
by: rahulj | last post by:
Some of the queries, in our application, have trailing semicolon which works fine when the application uses DB2 CLI Native Driver. But when the driver is changed to DB2 Type 4 Universal Driver an error is thrown by the driver due to trailing semicolon (i.e removing the semicolon resolves the issue). The question is that what is the way to specify the statement delimiter for DB2 Universal Type 4 driver, failing which the above error is...
0
10237
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10017
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9882
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.