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 > 42610 Invalid use of a parameter marker ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-29-07, 09:20
raysefo raysefo is offline
Registered User
 
Join Date: Dec 2006
Posts: 17
42610 Invalid use of a parameter marker ?

Hi,

I have a select statement below which gives "AbtError: rc=-1 for '42610' in
an AbtIbmCliCSDatabaseConnection at (29.01.2007 15:43:13)
'[SQLSTATE=42610 - [IBM][CLI Driver][DB2/NT] SQL0418N A statement contains
a use of a parameter marker that is not valid. SQLSTATE=42610 [Native
Error=-418]]" error when i put it into multirow query. I guess its beacause
of variables beside the CASE expressions. How can i fix this?

select
sf.tldno,op.personelref,k.eskikod,p.siralama,o.adi ,o.soyadi,s.deep,s.eye,s.shallow,s.notron,s.beta,s .gama,s.yorum,s.sonuc,k.calismaalani,k.aktifmi
from
(dzmt.sonuc s
LEFT OUTER JOIN dzmt.dagitim d ON s.dagitimid = d.id
LEFT OUTER JOIN dzmt.sifirlama sf ON s.sifirlamaid = sf.id)
,dzmt.priyotlar p,rsgd.org_personelbilgileri o,dzmt.donemsayac
ds,dzmt.kurumdetay k,rsgd.org_personelindex op
where
d.periyodid = p.id and
p.yil = :yil and
d.personelid = o.id and
sf.donemsayacid = ds.id and
k.id = ds.kurumkod and
op.personelref = o.id and
((s.sonuc = (CASE :sonuc
when 'E' then 'E'
when 'GELMEYEN' then 'A'
END)) or ((s.deep between (
CASE :sonuc
when 'MDL-0.99' then 0.1
when '1.0-4.9' then 1
when '5.0-9.9' then 5.0
when '10.0-14.9' then 10.0
when '15.0-19.9' then 15.0
when '20.0-29.9' then 20.0
when '>30.0' then 30
when 'MDL' then 0
END) and (CASE :sonuc
when 'MDL-0.99' then 1
when '1.0-4.9' then 4.9
when '5.0-9.9' then 9.9
when '10.0-14.9' then 14.9
when '15.0-19.9' then 19.9
when '20.0-29.9' then 29.9
when '>30.0' then 1000
when 'MDL' then 0.1
END))))
Reply With Quote
  #2 (permalink)  
Old 01-29-07, 10:00
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Please tell us a bit about your environment: DB2 environment, application programming language, ...

My guess would be that you do not have embedded SQL and, therefore, DB2 does not know the data type of your host variable and can also not derive it from column definitions and the like. So you will have to explicitly "type" your parameter marker:
Code:
CAST(:marker AS INTEGER)
p.s: It would be a good idea to scale down your query to the point that the error still occurs but the stmt is very simple (just a few lines).
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 01-29-07, 10:05
raysefo raysefo is offline
Registered User
 
Join Date: Dec 2006
Posts: 17
I m using DB2 ver 8.02 and development env. is VASmalltalk 6.02. But it seems like working when i use CAST.
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