473,320 Members | 1,600 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,320 software developers and data experts.

DB2 equivalent INFORMIX.EXTEND

hi

Is there a DB2 equivalent of Informix.Extend function?

or please help me the best way to create one

Thanks
rick

Mar 20 '07 #1
4 3821
Ian
rick wrote:
hi

Is there a DB2 equivalent of Informix.Extend function?
Although there may be a few Informix people here, it would
be helpful for the rest of us if you tell what this function
does.

Or at least provide a pointer to the reference material
for the function.
Mar 20 '07 #2
Hi IAN
The EXTEND function adjusts the precision of a DATETIME or DATE value.
The expression cannot be a quoted string representation of a DATE
value.

If you do not specify first and last qualifiers, the default
qualifiers are YEAR TO FRACTION(3).

If the expression contains fields that are not specified by the
qualifiers, the unwanted fields are discarded.

If the first qualifier specifies a larger (that is, more significant)
field than what exists in the expression, the new fields are filled in
with values returned by the CURRENT function. If the last qualifier
specifies a smaller field (that is, less significant) than what exists
in the expression, the new fields are filled in with constant values.
A missing MONTH or DAY field is filled in with 1, and the missing HOUR
to FRACTION fields are filled in with 0

and below is the code I have.

CREATE FUNCTION "INFX "."EXTEND" ( DATE TIMESTAMP, UPPER1
INTEGER, LOWER1 INTEGER, UPPER2 INTEGER,LOWER2 INTEGER)

RETURNS TIMESTAMP
SPECIFIC SQL050909191710600
EXTERNAL NAME 'com.ibm.db2.tools.mtk.mtkinfxudf.infxUDFs! extend()'
LANGUAGE JAVA
PARAMETER STYLE JAVA
NOT VARIANT
FENCED THREADSAFE
NOT NULL CALL
NO SQL
NO EXTERNAL ACTION
NO SCRATCHPAD
NO FINAL CALL
ALLOW PARALLEL
NO DBINFO;

thanks
Rick
On Mar 20, 2:16 am, Ian <ianb...@mobileaudio.comwrote:
rick wrote:
hi
Is there a DB2 equivalent of Informix.Extend function?

Although there may be a few Informix people here, it would
be helpful for the rest of us if you tell what this function
does.

Or at least provide a pointer to the reference material
for the function.

Mar 20 '07 #3
Ian
rick wrote:
The EXTEND function adjusts the precision of a DATETIME or DATE value.
The expression cannot be a quoted string representation of a DATE
value.

If you do not specify first and last qualifiers, the default
qualifiers are YEAR TO FRACTION(3).
Well, DB2 doesn't support varying precision. There are 3 date/time
datatypes:

date (date only)
time (time only)
timestamp (equivalent to YEAR TO FRACTION(6), if it existed)
Because there's no concept of different precisions for a timestamp,
I'm not really sure if this function actually applies in DB2.

However, I am confused by the function definition you show from
the IBM Migration Toolkit (MTK). My guess is that it simply
returns a timestamp with all of the "insignificant" values zeroed
out, i.e.

2007-03-20-12.00.00.000000

(i.e. that's extending a date to include the current hour). But
I wouldn't consider this to be the same as a DATETIME YEAR TO HOUR.
Does this MTK function not provide what you're looking for?

Ian
Mar 20 '07 #4
On Mar 19, 10:09 pm, "rick" <kantha...@gmail.comwrote:
hi

Is there aDB2equivalent of Informix.Extend function?

or please help me the best way to create one

Thanks
rick
DB2 doesn't have equivalent function hence MTK providing as JAVA UDF,
if you further question please contact to mt*@us.ibm.com

Mar 23 '07 #5

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

Similar topics

3
by: Christian Eriksson | last post by:
Hi! I'm programming Perl DBI accessing Informix databases. I have a problem on a Solaris machine to use my installed Informix driver (DBD::Informix). I get the following error message: ...
0
by: Rajiv Jhaveri | last post by:
Folks, In INFORMIX there is a default value called DBSERVERNAME that can be assigned to a column during the table definition as follows: create table t1 (c1 char(18) default DBSERVERNAME ); ...
3
by: Lee | last post by:
Hi, I'm developing a socket program to connect to Informix database through the ODBC. In here i called my socket program as "tap" . My tap will listen for data from unix through port 1070. After...
4
by: Matt | last post by:
Hello. I have an Informix SQL statement that I need to run in MS SQL Server. When I try to execute it I get the following error message from Query Analyzer: Server: Msg 195, Level 15, State 10,...
10
by: Joachim Banzhaf | last post by:
Hi, Creating the federated datasource library for informix fails for me. The db2 server is version 8.1 WSE on AIX 4.3. The informix client on this server is version CSDK 2.81/ESQL 9.53 UC2....
0
by: Bernard Dhooghe | last post by:
Suppose a set of programs written in ESQL (C or Cobol) or 4GL, accessing an Informix database. Suppose the Informix' customer owning the souces is willing to see how DB2 could help him, so a DB2...
0
by: vishalp79 | last post by:
Hi, I am trying to install DBD::Informix module on perl on hpux 11.23 machine. but i get this weird error ...... Set up gcc environment - 4.1.1 *** ExtUtils::AutoInstall version 0.61 ***...
0
by: Lester Knutsen | last post by:
A two-day IBM Informix and DB2 User Group Technical Conference - Friday and Saturday, December 8-9, 2006 We are very please to announce our Keynote Speakers...
14
by: Khan | last post by:
Hello, I want to connect my intranet server (with php/apache) to the other informix database server, But I didnt it. I dont know how i can do it? Can i use php_informix extensions for example...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.