473,748 Members | 6,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL0418N error: Untyped parameter markers cannot be used in some cases???

Hi all,

In my application that is generated by Clarion an SQL0418N ("A statement
contains a use of a parameter marker that is not valid.") occurs. In the
explanation section it says "in some cases as the sole argument of a scalar
function". The parameter marker is used in the UCASE function.

Is this such "some case"??

The full error provided by Clarion's trace:

Preparing Statement 1ae2350 : SELECT A.LANDCODE, A.SOORTLAND, A.LANDNAAM,
A.LANDCODE_CBS FROM MUNTSYS.LANDEN A WHERE {fn UCASE( A.LANDCODE)} >= {fn
UCASE(?)} ORDER BY {fn UCASE( A.LANDCODE)} Time Taken:0.00 secs
Setting number of rows to fetch to 20 for Statement 1ae2350 Time Taken:0.00
secs
Binding Column 1 to C type CHAR for Statement 1ae2350 Time Taken:0.00 secs
Binding Column 2 to C type UTINYINT for Statement 1ae2350 Time Taken:0.00
secs
Binding Column 3 to C type CHAR for Statement 1ae2350 Time Taken:0.00 secs
Binding Column 4 to C type SSHORT for Statement 1ae2350 Time Taken:0.00 secs
Binding ? 1 for input with C type CHAR as 1 for Statement 1ae2350 Time
Taken:0.00 secs
Executing prepared Statement 1ae2350
Error Occurred: 42610[IBM][CLI Driver][DB2/LINUX] SQL0418N A statement
contains a use of a parameter marker that is not valid. SQLSTATE=42610
--
Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.***********@A skesis.nl
web: www.askesis.nl
Nov 12 '05 #1
1 14241
The problem is in UCASE(?). If you read the rules for function resolution in
the SQL Reference, you'll see that they are very sensitive to the data
types of the parameters. Unfortunately, a parameter marker doesn't have a
type when it is precompiled, so DB2 doesn't know what type to use and you
get the error.

The solution is to use a CAST around the parameter marker to tell DB2 what
type to expact. For example:
UCASE(CAST(? AS CHAR(10))
UCASE(CAST(? AS VARCHAR(50))
The Db2 knows what type to use for the parameter marker and the function can
be properly resolved.

Note that the type in the CAST and the actual type bound in to the parameter
marker do _not_ have to be identical - they just have to be compatible. So,
if I have UCASE(CAST(? AS VARCHAR(50)), I can bind in a VARCHAR(50) or a
CHAR(10) or any other type that is compatible with a VARCHAR(50). If I try
to bind in a VARCHAR(51), however, I'll get a string too long error.

Hope this helps.

--
_______________ _______________ _______________ _______________ _________
Doug Doole
DB2 Universal Database Development
IBM Toronto Lab

Visit the DB2 UDB and DB2 Connect Online Support site at:
http://www.ibm.com/software/data/db2...s2unix/support
Nov 12 '05 #2

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

Similar topics

67
4276
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. Unfortunately these ad hominem rhetorts are frequently introduced into purely technical discussions on the feasibility of supporting such functionality in C++. That usually serves to divert the discussion from the technical subject to a discussion of the...
1
2054
by: Mike | last post by:
Envirnoment is UDB 7.2 fp9 on AIX. I'm familiar with using "dynexpln" for quickly comparing access plans for directly executable queries. dynexpln docs suggest it cannot work with sql that contains parameter markers. But, when there is no Control-centre (i.e. text only access via korn-shell, no x-windows), how can I use db2 on aix command line programs
5
3780
by: Amaryllis | last post by:
I'm trying to call a CL which is located on our AS400 from a Windows application. I've tried to code it in different ways, but I seem to get the same error every time. Does anyone have any clue as to what this means? I am not trying to alter a table. This particular CL merely generates the next voucher number in a sequence. "SQL0204: HRCU030P in HRZNCUSOBJ type *N not found. Cause . . . . . : HRCU030P in HRZNCUSOBJ type *N was...
669
26100
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
9
2940
by: Jim | last post by:
Hello, I'm trying to write exception-handling code that is OK in the presence of unicode error messages. I seem to have gotten all mixed up and I'd appreciate any un-mixing that anyone can give me. I'm used to writing code like this.
7
7211
by: =?ISO-8859-2?Q?Gregor_Kova=E8?= | last post by:
Hi! Is it possible to use parameter markers like this: 1.) SELECT * FROM TABLE1 WHERE FIELD1 LIKE '%?%' If I now set parameter 1 to '' (empty string) I don't get any rows back, but if I run: 2.) SELECT * FROM TABLE1 WHERE FIELD1 LIKE '%%' I get back data I expect.
2
3569
by: PaulR | last post by:
Hi, (DB2 LUW v8.2) When using parameter markers how does the optimizer evaluate filter factors? - and is it able to make use of distribution stats. for parm. markers? The reason I ask, is we have heavily skewed data in places and we need
4
2786
by: Sheldon | last post by:
Hi, I have a unique case where I need an array of structs that grows and within this array is another struct that grows in some cases. I'm having trouble allocating memory. Since I have never done this before, I'm sure it's a rookie mistake but I cannot seem to find it. Can someone render some assistance please? struct Fpos { grib_handle *h;
5
2939
by: Nike1984 | last post by:
I'm fairly new to Javascript and it's more of a guessing game for me... I'm trying to build an app for Google Maps and just had some issues recently. First off I just wanted to say that everything works fine in FF and IE. It's Chrome I'm having issues with. I understand that Chrome is still somewhat in beta stages, so some bugs might occur. However this seems like something I might have done. So... I used a code that I found on Econym as...
0
8987
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8826
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,...
0
9366
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
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.