| Author |
Bad sql grammer
|
raj chopra
Ranch Hand
Joined: Apr 09, 2012
Posts: 50
|
|
Hi All,
My project involves struts1.2,springs1.2,hibernate 3.0
To display few details in the jsp page , i wrote a query in dao layer and created the related pojo files and hbm files etc
query is :
" select billingaddress.billingaddressLine1,billingaddress.billingaddressLine2,billingaddress.city,billingaddress.firstName,billingaddress.middleName,billingaddress.lastName,"+
" billingaddress.pager,"+
" billingaddress.altPhone,billingaddress.officePhone,billingaddress.cellular,"+
" billingaddress.state,billingaddress.zip,billingaddress.email"+
" from SBBillingAddress billingaddress"+
" where memberid =?"
Below i mention the exception
|
Reagrds,
raj chopra
|
 |
Sai Rao
Greenhorn
Joined: Mar 23, 2007
Posts: 4
|
|
|
Hello Raj, Have you checked if the table SBBillingAddress has a field labelled 'Memberid'? Or is it 'member_id'? Please verify the column name used - it seems to be the likely cause of the error you have posted.
|
 |
raj chopra
Ranch Hand
Joined: Apr 09, 2012
Posts: 50
|
|
Hi sai,
thanks for reply,
Sai Rao wrote:Hello Raj, Have you checked if the table SBBillingAddress has a field labelled 'Memberid'? Or is it 'member_id'? Please verify the column name used - it seems to be the likely cause of the error you have posted.
I have cross checked my table in database, pojo class(SBBillingAddress), and hbm file(SBBillingAddress.hbm.xml) all are fine.
also one more thing is that memberid is defined as primary key in hbm file.
|
 |
Reddy Prashanth
Ranch Hand
Joined: Aug 09, 2005
Posts: 61
|
|
|
In your query use "where billingaddress.memberid =?" instead of "where memberid =?"
|
 |
raj chopra
Ranch Hand
Joined: Apr 09, 2012
Posts: 50
|
|
Hi prashanth,
Thanks for reply,
Reddy Prashanth wrote:In your query use "where billingaddress.memberid =?" instead of "where memberid =?"
Problem got solved.thanks a ton
|
 |
 |
|
|
subject: Bad sql grammer
|
|
|