473,748 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3853
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 SQL050909191710 600
EXTERNAL NAME 'com.ibm.db2.to ols.mtk.mtkinfx udf.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...@mobile audio.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 "insignific ant" 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...@gmai l.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
7204
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: install_driver(Informix) failed: Can't load '/usr/perl5/5.6.1/site_perl/sun4-solaris/auto/DBD/Informix/Informix.so' for module DBD::Informix: ld.so.1: /usr/bin/perl: fatal: libifsql.so: open failed: No such file or directory at
0
2237
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 ); Is there an ORACLE 9i equivalent for DBSERVERNAME that can be used in the table.column definition? PS : DBSERVERNAME in INFORMIX is the instance name
3
6065
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 checking of the data, tap will then insert the data to the informix database. I know we can point the tap to one specified port in Informix database through the services file. My question is how should i know to which port my tap program send out...
4
16786
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, Line 4 'date' is not a recognized function name. Can anyone help me convert this informix sql statement into and MS Sql Statement? Here is the query I have:
10
5521
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. When I run djxlink as root, I get the followin messages: # /usr/opt/db2_08_01/bin/djxlink /usr/opt/db2_08_01/bin/djxlinkInformix: nm: /informix/clientsdk/lib/esql/libifgen.a: 0654-200 Cannot open the
0
1692
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 install alongside the Informix environment is looked at. Questions: - will IBM have an universal precompiler allowing to precompile
0
1818
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 *** Checking for dependencies... - DBI ...loaded. (1.52 >= 1.38) - Time::HiRes ...loaded. (1.86)
0
2662
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 --------------------------------------------------- * Friday, December 8, 2006 – Ambuj Goyal, General Manager of IBM Information Management * Saturday, December 9,2006 - Arvid Krishna, Vice President of Database Servers, IBM Information Management These are the top two executives...
14
11654
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 ifx_connect(); I was read this article: http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0606bombardier/index.html and doing step one step but i was not success.
0
8983
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8822
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9528
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
9310
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
6072
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
4592
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...
0
4863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3298
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
2774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.