Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2007-01-29 : 09:17:40
|
| 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(:sonuc). 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.aktifmifrom(dzmt.sonuc sLEFT OUTER JOIN dzmt.dagitim d ON s.dagitimid = d.idLEFT 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 opwhered.periyodid = p.id andp.yil = :yil andd.personelid = o.id andsf.donemsayacid = ds.id andk.id = ds.kurumkod andop.personelref = o.id and((s.sonuc = (CASE :sonucwhen 'E' then 'E'when 'GELMEYEN' then 'A'END)) or ((s.deep between (CASE :sonucwhen 'MDL-0.99' then 0.1when '1.0-4.9' then 1when '5.0-9.9' then 5.0when '10.0-14.9' then 10.0when '15.0-19.9' then 15.0when '20.0-29.9' then 20.0when '>30.0' then 30when 'MDL' then 0END) and (CASE :sonucwhen 'MDL-0.99' then 1when '1.0-4.9' then 4.9when '5.0-9.9' then 9.9when '10.0-14.9' then 14.9when '15.0-19.9' then 19.9when '20.0-29.9' then 29.9when '>30.0' then 1000when 'MDL' then 0.1END)))) |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-01-29 : 09:34:10
|
| If this is SQL Server, rather than DB2, then there is no colon in a CASE statementChange:CASE :sonuc when 'E' then 'E' when 'GELMEYEN' then 'A' ENDtoCASE sonuc when 'E' then 'E' when 'GELMEYEN' then 'A' ENDKristen |
 |
|
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2007-01-29 : 09:44:36
|
| But those are variables that i sent data dynamically to them. |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-01-29 : 09:46:27
|
| Use @ instead of : as a prefix (unless you are using embedded Sql with C)Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-01-29 : 09:48:11
|
| OK, so::sonucis a variable, rather than a Column in one of the tables in a query?In SQL Server you use variables with this style syntax:@sonucIf this is NOT specifically for SQL Server then all bets are off I'm afraid as this is a SQL Server (only) forum / site.Kristen |
 |
|
|
|
|
|
|
|