Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

conversion from db2 to oracle

Question posted by: lenygold via DBMonster.com (Guest) on July 29th, 2008 01:05 PM
I find this expression in Oracle query:
cast(convert(char(10)
,dateadd(d,i,start),120) as datetime ) as taskday.
How to convert it in DB2?
Thank's in advance LENY g.

--
Message posted via http://www.dbmonster.com

DA Morgan's Avatar
DA Morgan
Guest
n/a Posts
July 29th, 2008
03:25 PM
#2

Re: conversion from db2 to oracle
lenygold via DBMonster.com wrote:
Quote:
I find this expression in Oracle query:
cast(convert(char(10)
,dateadd(d,i,start),120) as datetime ) as taskday.
How to convert it in DB2?
Thank's in advance LENY g.


DATEADD is not an Oracle function. Oracle dates are dates, not strings.
Also, in Oracle, dates should be stored as the DATE or TIMESTAMP data
types not as a character string.
--
Daniel A. Morgan
University of Washington
Join Bytes! (replace x with u to respond)

The Boss's Avatar
The Boss
Guest
n/a Posts
July 29th, 2008
09:15 PM
#3

Re: conversion from db2 to oracle
lenygold via DBMonster.com wrote:
Quote:
I find this expression in Oracle query:
cast(convert(char(10)
,dateadd(d,i,start),120) as datetime ) as
taskday. How to convert it in DB2?
Thank's in advance LENY g.


As far as I know, "dateadd" is neither an Oracle nor a DB2 function.
Your query is probably written for MS Access or for Transact-SQL (MS SQL
Server or Sybase).

You will find some info on converting MS SQL Server's "dateadd"-function to
DB2 in this Redbook:
"Microsoft SQL Server to IBM DB2 UDB Conversion Guide" (Chapter 4.3.3)
http://www.redbooks.ibm.com/redbooks/pdfs/sg246672.pdf

You may also want to have a look at Graeme Birchall's "DB2 SQL Cookbook".
It has excellent examples of DB2's SQL 'dialect' and an extensive list of
DB2 Functions.
http://mysite.verizon.net/Graeme_Birchall/id1.html

HTH

Cheers!

--
Jeroen



lenygold via DBMonster.com's Avatar
lenygold via DBMonster.com
Guest
n/a Posts
July 29th, 2008
11:55 PM
#4

Re: conversion from db2 to oracle
THANK YOU VERY MUCH FOR YOUR HELP.

The Boss wrote:
Quote:
Quote:
>I find this expression in Oracle query:
>cast(convert(char(10)
> ,dateadd(d,i,start),120) as datetime ) as
>taskday. How to convert it in DB2?
>Thank's in advance LENY g.

>
>As far as I know, "dateadd" is neither an Oracle nor a DB2 function.
>Your query is probably written for MS Access or for Transact-SQL (MS SQL
>Server or Sybase).
>
>You will find some info on converting MS SQL Server's "dateadd"-function to
>DB2 in this Redbook:
>"Microsoft SQL Server to IBM DB2 UDB Conversion Guide" (Chapter 4.3.3)
>http://www.redbooks.ibm.com/redbooks/pdfs/sg246672.pdf
>
>You may also want to have a look at Graeme Birchall's "DB2 SQL Cookbook".
>It has excellent examples of DB2's SQL 'dialect' and an extensive list of
>DB2 Functions.
>http://mysite.verizon.net/Graeme_Birchall/id1.html
>
>HTH
>
>Cheers!
>


--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums...bm-db2/200807/1


 
Not the answer you were looking for? Post your question . . .
189,879 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors