#83 SQL SELECT RANDOM

open
nobody
None
5
2010-06-04
2010-06-04
danieleacme
No

Hi Venkat,
I've tested the version 06-03-2010 :

//exec sql
// select
// ao_nome ,
// ao_ind ,
// ao_cap ,
// ao_loc ,
// ao_prov ,
// ao_dt_agg
// into
// :a--ao-nome ,
// :a--ao-ind ,
// :a--ao-cap ,
// :a--ao-loc ,
// :a--ao-prov ,
// :a--ao-dt-agg
// from a_an_op
// where ao_cod = :a--ao-cod
//end-exec
try {
__dao().prepareStatement("select "+
"ao_nome , "+
"ao_ind , "+
"ao_cap , "+
"ao_loc , "+
"ao_prov , "+
"ao_dt_agg "+
"from "+
"a_an_op "+
"where "+
"ao_cod "+
"= "+
"?") ;
__dao().setString(1,a_anOp.getA_aoCod());
__dao().executeUpdate();
if(__dao().resultExists()) {
a_anOp.setA_aoNome(__dao().getString(1));
a_anOp.setA_aoInd(__dao().getString(2));
a_anOp.setA_aoCap(__dao().getString(3));
a_anOp.setA_aoLoc(__dao().getString(4));
a_anOp.setA_aoProv(__dao().getString(5));
a_anOp.setA_aoDtAgg(__dao().getString(6));
}

This command has been translated
__dao().executeUpdate();
in place of
__dao().executeQuery();

Looking inside com.res.java.translation.engine.ExecSql2Java , method private void printQuery(String cursorName)

Regards
Daniele

Discussion

  • VenkatK
    VenkatK
    2010-06-04

    Yes. It was an oversight while changing code.

    Fixed. Avaialable in the next upload.