Hi everybody-
I have a trouble with one of my EJBs and need a quick solution.
Following SQL is returning "null" :
public Vector csfMiddlInfo (String sJobReqNb, String sTastType)
{
try
{
RdbmService db = new RdbmService ("UM_HR", new UM_HR_CsfMiddlDB ());
String sQuery = "select
a.disposition_dt,a.emplid,a.app_status,a.disposition_reason, " +
"b.name,b.per_status,j.jobcode,d.descr,c.job_entry_dt,c.service_dt,c.annual_rt,
" +
"f.m_hr_rif_status, 0,b.sex, div.ethnic_group " +
"from ps_posn_appliedfor a " +
",ps_personal_data b " +
",ps_m_hr_ee_curr_vw c " +
",ps_dept_tbl d " +
",ps_m_hr_pers_data f " +
",ps_jobcode_tbl j " +
",ps_diversity div " +
"where a.job_requisition# = ? " +
"and b.emplid = a.emplid " +
"and c.emplid = a.emplid " +
"and f.emplid = a.emplid " +
"and div.emplid = a.emplid " +
"and j.jobcode = c.jobcode " +
")";//this sql is much longer, but this is enough to
illustrate the issue
PreparedStatement pStmt = db.prepareStatement (sQuery);
pStmt.setString (1, sJobReqNb);
pStmt.setString (2, sJobReqNb);
db.executePreparedStatement (pStmt);
Vector vector = db.getData (0);
db.closeStatement ();
if (vector.size () == 0)
{
return null;
}
return vector;
}
catch (Exception e)
{
log (ERROR, e);
return null;
}
}
I know that '0' in the third line (f.m_hr_rif_status,0,b.sex, div.ethnic_group)
is the reason for this -- I tested it with a valid value instead of '0'
and it worked -- it pulled about 10 records. I tested this SQL in Oracle
too, and it works fine (with '0', of course) -- again many records. It
seems that Java does not like '0'.
Any explanation and suggested solution would be greatly appreciated.
Thank you all.
Kat
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets