473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

What the problem with VARCHAR_FORMAT?!?!?!

Hi.

Please see into the

http://publib.boulder.ibm.com/infoce...bafzmst280.htm

My question is - WHY I CANNOT USE

VARCHAR_FORMAT(callofti, 'YYYY-MM-DD')

or

VARCHAR_FORMAT(callofti, 'HH24:MI')

?

It is always reporting

SQL Result : -171. SQL0171N The data type, length or value of argument
n of routine name is incorrect.

My database version is IBM DB2 v8.2.7

How to make it working?!
I mean - VARCHAR_FORMAT(callofti, 'YYYY-MM-DD').
Regards,
Dmitry,
Nov 18 '08 #1
2 7017
Dmitry Bond. wrote:
Hi.

Please see into the

http://publib.boulder.ibm.com/infoce...ndex.jsp?topic
=/com.ibm.etools.iseries.langref2.doc/rbafzmst280.htm

My question is - WHY I CANNOT USE

VARCHAR_FORMAT(callofti, 'YYYY-MM-DD')

or

VARCHAR_FORMAT(callofti, 'HH24:MI')

?

It is always reporting

SQL Result : -171. SQL0171N The data type, length or value of argument
n of routine name is incorrect.

My database version is IBM DB2 v8.2.7

How to make it working?!
I mean - VARCHAR_FORMAT(callofti, 'YYYY-MM-DD').
The second parameter in 8.2.7 is rather hilariously pointless. As you
can see from the documentation [1] the second parameter is literally
only permitted to be 'YYYY-MM-DD HH24:MI:SS' (when it says "valid
format strings are", read that as "the ONLY valid format string is").
The function was extended in DB2 9.5 to accept a far wider variety of
possible format strings as you can see from the updated documentation
[2]. If you don't mind using a UDF for formatting timestamps, have a
look at this earlier thread [3] which contains several pretty
comprehensive definitions.
[1]
http://publib.boulder.ibm.com/infoce...om.ibm.db2.udb
..doc/admin/r0007110.htm

[2]
http://publib.boulder.ibm.com/infoce.../com.ibm.db2.l
uw.sql.ref.doc/doc/r0007110.html

[3]
http://groups.google.com/group/comp....se_thread/thre
ad/555ffb95092ffb07
Cheers,

Dave.

--

Nov 18 '08 #2
PS: The OP also used DB2 for iSeries docs....

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Nov 19 '08 #3

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

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
92
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
86
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
72
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
17
Banfa
by: Banfa | last post by:
I felt that this was a good point to start a tutorial on C/C++ programming because clearly we need to have some idea of what we are trying to achieve before we start out. I recently found this...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
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...

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.