473,585 Members | 2,596 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 MIGRATION: SYBASE Functions list

All,

We have listed out the INBUILT Function differences between Sybase and
DB2.

Kindly provide your feedback or corrections and for CHANGES - DO WE
NEED TO CODE our own UDFs?

STRING FUNCTIONS

SYBASE DB2 REMARKS
=============== ==========
ABS ABS NO CHANGE
ACOS ACOS NO CHANGE
CEILING CEILING NO CHANGE
COS COS NO CHANGE
COT COT NO CHANGE
DEGREES DEGREES NO CHANGE
EXP EXP NO CHANGE
FLOOR FLOOR NO CHANGE
LOG LOG NO CHANGE
LOG10 LOG10 NO CHANGE
PI - NO EQUIVALENT
POWER POWER NO CHANGE
RADIANS RADIANS NO CHANGE
RAND RAND NO CHANGE
ROUND ROUND NO CHANGE
SIGN SIGN NO CHANGE
SIN SIN NO CHANGE
SQRT SQRT NO CHANGE
SQUARE - NO EQUIVALENT
TAN TAN NO CHANGE

AGGREGATE FUNCTIONS

SYBASE DB2 REMARKS
=============== =======
AVG AVG NO CHANGE
COUNT COUNT NO CHANGE
MAX MAX NO CHANGE
MIN MIN NO CHANGE
SUM SUM NO CHANGE

STRING FUNCTIONS

SYBASE DB2 REMARKS
=============== =============== ==========

ASCII ASCII NO CHANGE
CHAR CHR CHANGE
CHARINDEX POSSTROR LOCATE CHANGE 1
CHAR_LENGTH LENGTH NO CHANGE
DIFFERENCE DIFFERENCE NO CHANGE
LOWER LOWER OR LCASE OPTIONAL
LTRIM LTRIM NO CHANGE
PATINDEX POSSTR CHANGE 1
REPLICATE REPEAT CHANGE
REVERSE - NO EQUIVALENT
RIGHT RIGHT NO CHANGE
RTRIM RTRIM NO CHANGE
SOUNDEX SOUNDEX NO CHANGE
SPACE SPACE NO CHANGE
STR CHAR PARTLY EQUIVALENT 2
STUFF INSERT CHANGE
SUBSTRING SUBSTR CHANGE IN NAME SAME PARAMETERS

SYSTEM FUNCTIONS

SYBASE DB2 REMARKS
=============== =============== ==============

COL_LENGTH - NO EQUIVALENT
COL_SIZE - NO EQUIVALENT
CURUNRESERVEDPG S - NO EQUIVALENT
DATA_PGS - NO EQUIVALENT
DATALENGTH LENGTH CHANGE
DB_ID - NO EQUIVALENT
DB_NAME - NO EQUIVALENT
HOST_ID - NO EQUIVALENT
HOST_NAME - NO EQUIVALENT
INDEX_COL - NO EQUIVQLENT
ISNULL COALESCE NO CHANGE
ICT_ADMIN - NO EQUIVALENT
OBJECT_ID - NO EQUIVALENT
OBJECT_NAME - NO EQUIVALENT
PTN_DATA_PGS - NO EQUIVALENT
RESERVED_PGS - NO EQUIVALENT
ROWCNT - NO EQUIVALENT
SUSER_ID - NO EQUIVALENT
SUSER_NAME CURRENT USER CHANGE
TSEQUAL - NO EQUIVALENT
USED_PGS - NO EQUIVALENT
USER CURRENT USER CHANGE
USER_ID - NO EQUIVALENT
USER_NAME CURRENT USER CHANGE
VALID_NAME - NO EQUIVALENT
VALID_USER - NO EQUIVALENT

TEXT FUNCTIONS

SYBASE DB2 REMARKS
=============== =============== ==============

TEXTPTR - NO EQUIVALENT
TEXTVALID - NO EQUIVALENT

CONVERSION FUNCTIONS

SYBASE DB2 REMARKS
=============== =============== ==============
CONVERT PC CHANGE
HEXTOINT - NO EQUIVALENT
INTTOHEX HEX PARTIALLY EQUIVALENT 3

DATE FUNCTIONS

SYBASE DB2 REMARKS
=============== =============== ==============
DATEADD - DATE ARITHMETIC CAN BE USED
DATEDIFF - DATE ARITHMETIC CAN BE USED
DATENAME - DATE ARITHMETIC CAN BE USED
DATEPART - DATE ARITHMETIC CAN BE USED
GETDATE CURRENT TIMESTAMP CHANGE
SECURITY FUNCTIONS

SYBASE DB2 REMARKS
=============== =============== ==============
IS_SEC_SERVICE_ ON - NO EQUIVALENT
MUT_EXCL_ROLES - NO EQUIVALENT
PROC_ROLE - NO EQUIVALENT
ROLE_CONTAIN - NO EQUIVALENT
ROLE_ID - NO EQUIVALENT
ROLE_NAME - NO EQUIVALENT
SHOW_ROLE - NO EQUIVALENT
SHOW_SEC_SERVIC ES - NO EQUIVALENT


1. IN DB2 POSSTR IS A FUNCTION WHICH TAKES TWO ARGUMENTS POSSTR(
SOURCE_STRING EXPRESSION , SEARCH_STRING EXPRESSION) AND RETURNS AN
INTEGER WHICH DENOTES THE FIRST OCCURRENCE OF THE SEARCH STRING. IT
CAN BE USED FOR BOTH CHARINDEX AND PATINDEX FUNCTIONS OF SYBASE.

NOTE THAT IN DB2 , IN THE FUNCTION LOCATE THE STARTING POINT OF THE
SEARCH FROM WHERE THE SEARCH HAS TO BEGIN CAN ALSO SENT AS AN OPTIONAL
PARAMETER
LOCATE('I','POI NT SOLUTION'[,6])

2. IN SYB THE FUNCTION STR TAKES THREE ARGUMENTS
STR(APP_NUM[,LENGTH[,DECIMAL]]) WHERE APP_NUM IS A FLOAT, REAL OR A
DOUBLE PRECISION NUMBER, LENGTH IS THE LENGTH OF THE DECIMAL PART AND
DECIMAL DENOTES THE LENGTH OF THE FRACTIONAL PART. BUT IN DB2 THE
FUNCTION CHAR(IN THIS CONTEXT) TAKES TWO ARGUMENTS CHAR( EXP, DECIMAL
CHAR) WHERE EXP IS AN EXPRESSION THAT RESULTS IN A DECIMAL NUMBER OR
A FLOATING POINT NUMBER AND DECIMAL CHAR IS THE CHARACTER THAT
DENOTES THE CHARACTER USED AS A DECIMAL POINT.

3. IN DB2 THE FUNCTION HEX CAN TAKE ANY BUILT I N DATATYPE AS ARGUMENT.
IN THIS CONTEXT WE CAN GIVE INTEGER EXPRESSION.

Nov 12 '05 #1
1 8318
db*****@gmail.c om wrote:
All,

We have listed out the INBUILT Function differences between Sybase and
DB2.

Kindly provide your feedback or corrections and for CHANGES - DO WE
NEED TO CODE our own UDFs?

If you download the migration tool kit (MTK):
http://www-306.ibm.com/software/data/db2/migration/mtk/
it will come with a library of SQL and Java functions and I believe now
with source code for matching C UDF (C UDF are a lot faster).

If teh only difference between sybase and DB2 is the name you can use so
called "sourced" functions (function synonyms).
For fucntions that just provide a constant (PI) or are simple
expressions I recommend using SQL Functions.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2

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

Similar topics

2
1920
by: Raquel | last post by:
We ran Migration toolkit to look into the possibility of migrating from SYBASE to UDB. The following statement in SYBASE: INSERT INTO GEST_TP ( GES_D, PC_N, IPD ) VALUES (
3
1405
by: aww91 | last post by:
Need product information on IBM's Integration Integrator (I.I) for conversion of SyBase calls to UDB calls. Production allows for conversion of modules one-by-one and then when all modules are converted the database (SyBase) can be converted and I.I removed. Last I heard the product was in beta. Any information would be appreciated...
2
1896
by: aww91 | last post by:
Company is planning a Sybase to UDB migration that is projected to take 1 year. During that long period of time any Code Freeze put into place would impact our users (we normally release code changes once a month). Any suggestions on how to manage a partial code freeze while under going a major migration like this one?
1
2061
by: pankaj_wolfhunter | last post by:
Greeting, Can anyone tell me the points to keep in mind while migrating data from Sybase to DB2 especially in case of LOB data. I know the books available on the IBM site, but if still someone can provide me their own specific points? Any help will be appreciated. TIA
2
1442
by: pankaj_wolfhunter | last post by:
Greetings, Can someone recommend me some online redbooks or any link regarding "Migration from Sybase to Sql Server"? Any feedback will be appreciated TIA
2
1235
by: pankaj_wolfhunter | last post by:
Greetings, Sybase authentication is managed by the database manager whereas DB2 relies on OS userid and password. when we migrate from sybase, there are certain applications that are using userid and password stored in sybase system tables. of course these are not OS based userid/password. now when we migrate to DB2 it checks for these...
9
4190
by: Troels Arvin | last post by:
At work, some people have found IBM's Migration Toolkit (MTK) to be a nice tool for copying data from one table (in another DBMS product) to DB2. Now, they want to do the same thing from one DB2 database to another DB2 database. - But MTK (surprisingly) doesn't seem to support DB2-DB2 copies. These are non-regular, ad-hoc tasks, performed...
2
2258
by: donnadimeo | last post by:
We are migrating a 300gb Sybase DB to DB2. How much can we expect the DB to grow (if at all) as a result of the migration? Give me a number on the safe side. Thanks, Donna
1
2011
by: aks reddy | last post by:
Did anybody worked on the migration from SYbase to UDB database or have any information. Please let me know with the details. Regards, Aks
0
7904
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...
0
7835
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...
0
8195
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. ...
0
8334
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8209
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...
0
6596
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5707
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...
0
5386
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...
1
2340
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

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.