hi, thank you for your answer! the fields were in the order of the mapping file, but I didn't select all fields. now I've selected all fields and everything works.
thanks, Joel Gautschi > -----Urspr�ngliche Nachricht----- > Von: franck routier [mailto:[EMAIL PROTECTED]] > Gesendet: Freitag, 22. Februar 2002 13:22 > An: [EMAIL PROTECTED] > Betreff: Re: [castor-dev] CALL SQL: Column Index out of range > > > Hi, > > from the doc : > > <QUOTE> > For example, > > OQLQuery oql = castorDb.getOQLQuery( > "CALL SQL SELECT id, name, date "+ > "FROM user WHERE upper(name) like $1"); > > > Be remember that the order of the fields listed must match what is > defined in the mapping file. > </QUOTE> > > Did you follow the last part, ie the order of the fields must > follow the > order of the mapping file. I also think ALL fields must be > selected (I'm > quite a newbie, correct me someone if I'm wrong) > > Regards, > > Franck Routier > > > le ven 22-02-2002 � 09:24, xMySign for Castor a �crit : > > Sorry for reposting my question. But I haven't found any > information in the > > documentation or on the mailinglist. > > Can anybody tell me what SQL statement (CALL SQL ...) is > equivalent to the > > OQL statement "SELECT p FROM myapp.Product p"? > > have a look at my old mail below. > > thanks. > > > > Joel Gautschi > > > > > hi, > > > > > > I'm evaluating castor for a project. It has to meet the > > > criteria that the > > > framework is able to pass through SQL statements. According to the > > > documentation castor is able to do that. > > > > > > if I try to run the following code: > > > --- > > > oql = db.getOQLQuery( "CALL SQL SELECT id, name, price, > > > group_id FROM prod AS > > > myapp.Product" ); > > > result = oql.execute(); > > > while ( result.hasMore() ) > > > { > > > // do something > > > } > > > --- > > > i get this error: > > > --- > > > javax.servlet.ServletException: > > > org.exolab.castor.jdo.PersistenceException: > > > Nested error: java.sql.SQLException: Column Index out of > > > range ( 5 > 4). > > > --- > > > > > > can someone tell me what I'm doing wrong? > > > > > > more information: > > > - if I use "oql = db.getOQLQuery( "SELECT p FROM > myapp.Product p" );" > > > everything works. > > > - myapp.Product is the class from > castor-0.9.3.9\src\examples\myapp > > > - I use castor 0.9.3 > > > - I use mm.mysql-2.0.11 as JDBC 2.0 driver > > > (class-name="org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource") > > > > > > > > > thanks in advance for your help! > > > > > > Joel Gautschi -------------------------------------------- MySign AG, Switzerland Web: http://www.mysign.ch -------------------------------------------- ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
