473,804 Members | 3,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which function has TOTAL equivalent to Oracle's TO_CHAR?

1 New Member
The Oracle function TO_CHAT accept DATE datatype. In DB2, i know that exist the VARCHAR_FORMAT function (synonym TO_CHAR), but this function only accepts TIMESTAMP datatypes.
How can i have the same result in DB2, like this SQL in Oracle:
SELECT to_char(data_en trada,'YYYYMM') FROM t1

Obs: data_entrada is of datatype DATE.

Thanks,
Wellerson
Aug 12 '09 #1
1 3857
vijay2082
112 New Member
upgarde to db2 udb V 9.7 or create the to_char equivalent in earlier udb database as in oracle database.

http://www.ibm.com/developerworks/da...dm-0712gosavi/

Regards

Vijay
Aug 12 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3054
by: Philippe LAVIGERIE | last post by:
What's wrong with my sample ? SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production PL/SQL Release 9.2.0.1.0 - Production CORE 9.2.0.1.0 Production TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
1
5661
by: JBBHF | last post by:
Hi i'm working on a web project, and i would like to make my oracle query work in mysql. select match.numero "nummatch", to_char(match.datematch, 'yyyy-MM-dd') "datematch", p1.numjoueur "j1", p2.numjoueur "j2", po1.p1 "m1p1", po1.p2 "m1p2", po2.p1 "m2p1",
0
1339
by: Error while executing SP | last post by:
Hi, I am getting "Unspecified error" using(System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection()) { cn.ConnectionString="Provider=OraOLEDB.Oracle;Password=STORED_OBJ;User ID=STORED_OBJ;Data Source=PDCDGL1.NA.HPFS.COM;Extended Properties=;Persist Security Info=False;PLSQLRSet=1;"; cn.Open(); //String strProcName = "{CALL pkg_product.SearchProd(?, ?, ?, ?, ?, ?, {resultset 0, CDFCursor})}";
4
24427
by: gimme_this_gimme_that | last post by:
What is the DB2 equivalent syntax of Oracle's : select to_char(created_date,'MM/DD/YYYY') from foo Thanks
14
3530
by: Najib Abi Fadel | last post by:
Hi, i am using PostgreSQL 7.3.2 there's a bug for the date '2005-03-27' !!!!!!!!!!!!!!!!!!!!!!!!!!! SELECT to_char('2005-03-27'::date,'DD/MM/YYYY'); to_char ------------ 26/03/2005 (1 row)
24
4167
by: clinttoris | last post by:
Could some please finish this line of code. For the life of me whatever I try it does not work. I am trying to insert the current date time into oracle. Now I know that in oracle if I run select to_char(sysdate, 'dd/mm/yy hh24:mi:ss') from dual result would be 15/06/06 14:49:35
5
2727
by: kalukum | last post by:
Hi Friend............. I am a oracle developer. I have a question, hope you would reply me.Thanks in advance for your time. I tried the following query : select c.cldt_status, a.ledg_clntidno, a.ledg_dctpcode,
0
1781
by: orausrture | last post by:
I am a newbie and really needs some assistance. I have struggled with this code. Any assistantance will be very appreciated. The code is below.... CREATE FUNCTION increment_serial_1 (p_serial_num VARCHAR(4000) ) RETURNS VARCHAR(4000) LANGUAGE SQL BEGIN ATOMIC DECLARE l_pattern VARCHAR(30) DEFAULT '';
0
1436
by: iitt2007 | last post by:
Hi I am newbie. I need to translate the following Oracle script to SQL Server 2005 script. I will appreciate your help and feedback. Thanks a lot in advance. ----------------------------------------------------------------------------------------------------------- test_reporting/here4fun@test_PROD SET NEWPAGE NONE; SET SPACE 0; SET LINESIZE 181;
0
9706
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
9579
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,...
1
10319
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
10076
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5520
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
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
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.