db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keshava Murthy" <kes...@bigtec.org>
Subject problem with sql query
Date Wed, 12 Feb 2003 07:56:28 GMT
Hi ,

The following method in screen class returns the data without any problem if
the database used is Oracle 8i and when I change the database to mysql or MSSQL the
method returns null value.

private Vector getPatientRegnData(){
 try
 {
 String strPin="1";
 String strEncNo="1";
 Criteria criteria          =  new Criteria();

criteria.addJoin(HisMasPatregnPeer.IPAT_INO_PREG,HisTrxPatrevisitPeer.IPAT_I
NO_PREG);

/* columns from his_mas_patregn table /*

 criteria.addSelectColumn(HisMasPatregnPeer.SPAT_FNAME_PREG);
 criteria.addSelectColumn(HisMasPatregnPeer.SPAT_MNAME_PREG );

/* columns from his_trx_patrevisit table /*

 criteria.addSelectColumn(HisTrxPatrevisitPeer.IPAT_ENCNO_PRVT);
 criteria.addSelectColumn(HisTrxPatrevisitPeer.DTPAT_RVTDTTM_PRVT);

 Criteria.Criterion a1  =
criteria.getNewCriterion(HisMasPatregnPeer.IPAT_INO_PREG,strPin,Criteria.LIK
E);
 Criteria.Criterion b1  =
criteria.getNewCriterion(HisTrxPatrevisitPeer.IPAT_ENCNO_PRVT,strEncNo,Crite
ria.LIKE);
 criteria.add(a1.and(b1));
  return HisMasPatregnPeer.doPSSelect(criteria);
 }
 catch (Exception e)
 {
 return null;
}
}

I also did some debugging and found that if I comment columns from
his_trx_patrevisit table the method returns vector conatins data.
I also checked the sql query generated(criteria.toString()) from mysql
prompt and it returns proper data, which means that addjoin query is not
working in mysql/mssql and it is working properly when oracle is the database
when application is run.

My question is why it is returning vector containg null  when I use mysql as
database?

regards,
Keshava Murthy. S




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message