From: stephane b. (JIRA) <nh...@gm...> - 2010-12-02 15:48:38
|
Db2400 Use of parameter marker not valid ---------------------------------------- Key: NH-2436 URL: http://216.121.112.228/browse/NH-2436 Project: NHibernate Issue Type: Bug Components: DataProviders / Dialects Affects Versions: 3.0.0.CR1 Reporter: stephane borel Priority: Minor Using db2 on iSeries when running: var query = from client in session.Query<Client>() where (client.name.Contains("XYZ")) orderby client.id select client; the following statement is generated: select client0_.ID as id0_, client0_.NAME as name0_ from DEVENV.CLIENTS client0_ where (client0_.NAME like ('%'||?||'%')) order by client0_.ID asc with parameter Name:p1 - Value:XYZ This causes error [iDB2SQLErrorException (0x80004005): SQL0418 Use of parameter marker not valid.] The reason is that db2 cannot guess the parameter's type. The parameters should be cast to the columns parameter. In this would generate the following statement: select client0_.ID as id0_, client0_.NAME as name0_ from DEVENV.CLIENTS client0_ where (client0_.NAME like ('%'||CAST(? as VARCHAR(255))||'%')) order by client0_.ID asc -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |