java - How to not replace named parameters in EntityManager.createNativeQuery()? -
I am using JBOSS AS 7 and I want to use this command before querying:
entityManager.createNativeQuery ("SET SET NLS_DATE_FORMAT = \" YYYY-MM-DD HH24: MI: SS \ "); Now if I urge this query, error message "All named parameters are not set: [MI: SS]" it is understood, and I Named Parameters and everything I understand. But in this case only I want this whole string not hidden.
I tried to set "parameter" "MI" to MI and "SS" to SS, but did not get any help from this. / P>
How can I set this query to fire without having to hibernate in trying to change the named parameter? Or how can I set this information to this server worldwide? In GB persistence.xml or standalone.xml?
Try with single quotes:
string sql = " Set session nls_date_format = 'YYYY-MM-DD HH24: MI: SS' "; entityManager.createNativeQuery (SQL);
Comments
Post a Comment