-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Error when executing Native SQL.
PostPosted: Tue Aug 30, 2005 8:19 pm 
Newbie

Joined: Tue Nov 30, 2004 2:37 pm
Posts: 16
This is what I am getting...

I am trying to execute a native SQL query as given below...
I am running hibernate 3.x and oracle 9.x database.
Could one of you please help, what I am doing wrong... ?

SELECT companyinf5_.NAME as impName
docket2_.DOCKET_YEAR as docketYear,
docket2_.DOCKET_SEQ as docketSeq,
docket2_.GAS_TYPE as gasType,
companyinf7_.NAME as suppName,
to_char(quarterlyt1_.ARRIVAL_DATE, 'yyyy-mm') as arrivalDate
,
sum(quarterlyt1_.VOLUME) as volume,
sum(quarterlyt1_.AVG_PRICE)/count(*) as avgPrice,
sum(quarterlyt1_.DEMAND_PRICE)/count(*) as demandPrice,
sum(quarterlyt1_.RESERVATION_FEE)/count(*) as reservationFee

FROM QRTRLY_TRANS_T quarterlyt0_,
QRTRLY_TRANS_INFO_T quarterlyt1_,
COMPANY_T company6_,
COMPANY_INFO_T companyinf7_,
POEE_T poee8_,
DOCKET_T docket2_,
DOCKET_COMPANY_T companies3_,
COMPANY_T company4_,
COMPANY_INFO_T companyinf5_
where docket2_.TERM_TYPE=:termType
and quarterlyt1_.ARRIVAL_DATE>=:startDate
and quarterlyt1_.ARRIVAL_DATE<:endDate
and quarterlyt0_.IMPORT_TRANS_ID=quarterlyt1_.ID
and quarterlyt1_.SUPPLIER_ID=company6_.ID (+)
and company6_.ID=companyinf7_.COMPANY_ID (+)
and quarterlyt1_.POEE_ID=poee8_.ID (+)
and quarterlyt0_.DOCKET_ID=docket2_.ID
and docket2_.ID=companies3_.DOCKET_ID
and companies3_.COMPANY_ID=company4_.ID
and company4_.ID=companyinf5_.COMPANY_ID
and companyinf5_.ACTIVE_IND =1
and companyinf7_.ACTIVE_IND (+) = 1
and poee8_.ID not in (314)
group by companyinf5_.NAME ,
docket2_.DOCKET_YEAR ,
docket2_.DOCKET_SEQ ,
docket2_.GAS_TYPE ,
companyinf7_.NAME ,
to_char(quarterlyt1_.ARRIVAL_DATE, 'yyyy-mm')
order by companyinf5_.NAME,
docket2_.DOCKET_YEAR,
docket2_.DOCKET_SEQ,
docket2_.GAS_TYPE,
companyinf7_.NAME,
to_char(quarterlyt1_.ARRIVAL_DATE, 'yyyy-mm')




30 Aug 20:03 WARN JDBCExceptionReporter - SQL Error: 923, SQLState: 42000
30 Aug 20:03 ERROR JDBCExceptionReporter - ORA-00923: FROM keyword not found wh
ere expected


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 8:26 pm 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
SELECT companyinf5_.NAME as impName,
docket2_.DOCKET_YEAR as docketYear,
docket2_.DOCKET_SEQ as docketSeq,
[...]

Comma?

Haven't checked the whole query.

Best regards
Sven

_________________
Please don't forget to give credit, if this posting helped to solve your problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 8:29 pm 
Newbie

Joined: Tue Nov 30, 2004 2:37 pm
Posts: 16
what a silly mistake... thanks a lot for your answer...
I totally missed the comma...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 8:35 pm 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
Well, that's ok for quite a long statement. :)
But I think you should take a few moments longer to read the SQL error.

Quote:
FROM keyword not found where expected

There was no problem with the FROM you had, but the database missed a FROM where it expected it to be.

Best regards
Sven

_________________
Please don't forget to give credit, if this posting helped to solve your problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.