syntax « SQL « JPA Q&A





1. How to force Hibernate to add quotes to generated SQL statements?    stackoverflow.com

Hibernate is generating invalid SQL for a particular criteria query. I can manually fix the query by adding single quotes to the value being used in the WHERE clause. To fix it, ...

2. How to implement capitalization in nHibernate?    stackoverflow.com

The below MS-SQL update script capitalizes the first letter of a word.
How does this statement look like in nHibernate HQL (criteria also ok) ?

UPDATE T_Example  
SET LANG_DE = UPPER(LEFT(LANG_DE, ...

3. HQL syntax problem    stackoverflow.com

I have a problem with the following HQL query:

select sum(MYTABLE.COUNTER) from (

select count(DISTINCT bi.products.id)  as COUNTER 
              ...

4. what's the syntax differnece between hibernate hql and sql?    coderanch.com

Yup, if you paste SQL into the MySQL query browser, that should run. When I'm having trouble with my queries, I often take the SQL generated by Hibernate, stuff it into the MySQL query browser, and see what happens. Sometimes, fiddling with the SQL can help me see what I've done wrong in my HQL or Criteria queries. HQL is Hibernate ...

5. hibernate usage--sql syntax error    coderanch.com

hi, i am newbee to hibernate and mysql. when i try to run a sample hibernate is giving me the following error Unsuccessful: create table EVENTS (EVENT_ID bigint generated by default as identity (start with 1), EVENT_DATE timestamp, title varchar(255), primary key (EVENT_ID)) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version ...

6. Error in SQL syntax?    forum.hibernate.org

Newbie Joined: Fri Jun 25, 2004 4:25 pm Posts: 4 Hibernate version: 2.1.3 This is the mapping file I'm using Code: ...

7. problem with invalid sql syntax, please help    forum.hibernate.org

I am new to hibernate and an exception org.springframework.jdbc.BadSqlGrammarException when i am writing my function test case. In my test case, i create a Person object and call dao to persist the data. But I got follow error. Hibernate: select nextval ('hibernate_sequence') Hibernate: /* insert com.slin.core.server.pojo.Person */ insert into person (date_Created, date_Updated, date_Last_Login, display_Name, date_Suspended, id) values (?, ?, ?, ?, ...

9. Can we call stored functions using Native SQL syntax?    forum.hibernate.org

Assumming I have a stored functions in Oracle database called getSalary() that takes employee id as parameter. I wonder whether we can call this function using Native SQL syntax, since if we use the hibernate stored procedures syntax, it requires us to return a resultset, which in my case, most of my existing functions return specific values and not a result. ...





10. Incorrect SQL syntax suddenly being generated    forum.hibernate.org

Application has been running now for two years and suddenly every insert statement has "select scope_identity()" appended to it causing a SQLGrammar exception. Hibernate: insert into record_verify (au_vers_numb, table_code, row_created_by, row_datetime_cb, row_last_mod_by, row_datetime_lmb, midistats_id, error_number) values (?, ?, ?, ?, ?, ?, ?, ?) select scope_identity() This just happened one day to the next. There have been NO changes to the ...

11. SQL syntax error in Hibernate request    forum.hibernate.org

12. SQL Syntax varies slightly depending on App Server    forum.hibernate.org

Hibernate version: Not sure database: DB2 for Linux V9.5 Other: jboss-4.2.2 Excuse my ignorance regarding Hibernate, but I am a DBA not a developer. The applicaiton I support is sumitting SQL syntax via Hibernate that is slightly different for each applicaton server. The basic SQL tables and columns are the same, but the column "labels" are sometimes different. For example : ...