var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: date formats
i am new to db2.i want date formats in db2(diffrent date formats) and how to execute those formats?
Can you be more specific. Also please state your OS and DB2 version.
date formats in db2
in oracle we are using date formate dd-mm-yy in this way .in db2 any equivalent formats are there.in diffrent ways....
C:\Program Files\IBM\SQLLIB\BIN>db2 values(char(current date,iso))
C:\Program Files\IBM\SQLLIB\BIN>db2 values(char(current date,eur))
C:\Program Files\IBM\SQLLIB\BIN>db2 values(char(current date,usa))
C:\Program Files\IBM\SQLLIB\BIN>db2 values(char(current date,local))
C:\Program Files\IBM\SQLLIB\BIN>db2 values(char(current date,jis))
ypu can further use substr function to edit the o/p
in oracle we are using concatnation symbol(||) per seperating two lines or combinding two lines .in db2 any equivalent is there.....
in oracle we are using concatnation symbol(||) per seperating two lines or combinding two lines .in db2 any equivalent symbol is there.....
db2 => select 'Rahul' || 'Singh' from sysibm.sysdummy1
but it is giving error on db2 clp ? dont know why..
neways you can also use concat scalar function
what is a package in db2 and structure of package.what is the use of package.give some examples.
in oracle we are using NVL function .any equivalent functuion is there in db2.(with example).
why dont you brush up your db2 basic from a free cook book available on net.
DB2 UDB V8.2
Graeme Birchall. search on google
neways ans. is coalesce function
How To Write Stored Procedure In Db2 And Syntax Of Stored Procedure.
google is your friend:
More specifically, see http://publib.boulder.ibm.com/infoce...n/r0008329.htm
(but maybe you are on a different platform or DB2 version).
P.S.: it's better to start a new thread in this forum if you have a new question!
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
in sql server we are using @@identity key word any equivalent key word is there in db2 and how many types of key words are there in db2.
The | simbol is operating system command. If you would like to use operating system commands like |, > or < you need to specifiy double quotes before and after the command so:
Originally Posted by rahul_s80
db2 "select 'Rahul' || 'Singh' from sysibm.sysdummy1"
Another way is to use CONCAT statement:
db2 select 'Rahul' CONCAT 'Singh' from sysibm.sysdummy1
Another way is to use CONCAT function:
db2 select CONCAT('Rahul', 'Singh') from sysibm.sysdummy1
I prefere using CONCAT as statement because it is the most readiable one.
NVL function is Oracle specific, COALESCE function is SQL standard. So use COALESCE instread of NVL for multidatabase support.
Originally Posted by raavi