If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > newbie DB2 SQL question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-13-10, 18:42
johnagrandy johnagrandy is offline
Registered User
 
Join Date: Aug 2010
Posts: 1
newbie DB2 SQL question

I am brand new to DB2. My background is SQL Server.

I installed DB2 Express C v.9.7.2 and IBM Data Studio.

In SQL Server Management Studio, I'd write some ad-hoc T-SQL like this :

declare @date1 date
declare @date2 date
declare @date3 date

set @date1 = CAST('1999-12-31' as date)

set @date2 = GETUTCDATE()

set @date3 = DATEADD(YEAR,-1,GETUTCDATE())


print @date1
print @date2
print @date3



How would I write similar in DB2 ?

Thanks.

Last edited by johnagrandy; 08-13-10 at 18:47.
Reply With Quote
  #2 (permalink)  
Old 08-13-10, 21:00
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
You would probably open IBM DB2 9.7 for Linux, UNIX and Windows Information Center, read the application development section, look at some samples, and you'd be good to go.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On