Hi, 

I want to do a count(*) and it doesn't work.

mapping.xml:
<?xml version="1.0"?>
<!DOCTYPE mapping SYSTEM "mapping.dtd">
<mapping>
<!--  Mapping pour Statrequete -->
<class name="fr.cmc.umm.mapping.statrequete.MRequeteStat" identity="string1">
        <description>StatRequete - table inexistante mais necessaire pour le 
mapping</description>
        <map-to table="StatRequete"/>
        <field name="string1" type="string">
        <!-- champ sql inexistant mais necessaire pour le mapping -->
                <sql name="s1"/>
        </field>
</class>
</mapping>

Classe MStatRequete :

private java.lang.String string1;
        private java.lang.String string2;
        private java.lang.String String3;
        private java.sql.Timestamp timeStamp1;
        private java.sql.Timestamp timeStamp2;
        private java.sql.Timestamp timeStamp3;
        private double double1;
        private double double2;
        private double double3;
        private long long1;
        private long long2;
        private long long3;
        private long long4;
getter 
setter
}

Query :
String l_query = "CALL SQL SELECT distinct ssm.libelle," +
"null,null, null,null,null, null,null,null," +
"count(a.SMIDDERNIERCONTACT),null,null,null " +
"null,null,null,null,null"  +
" from ABONNE a, sousmotif ssm " + 
" where a.SMIDDERNIERCONTACT is not null and " + "a.SMIDDERNIERCONTACT = ssm.SMID"+
" group by ssm.libelle" +
" AS fr.cmc.umm.mapping.statrequete.MRequeteStat";

And I have the next exception :
Nested error: java.sql.SQLException: ORA-00909: Nombre d'arguments incorrect  while 
executing SELECT distinct ssm.libelle,null,null,null,null,null,null,null,null,count()

=> If i replace count(*) by null, it work, i have a result.

Is someone has already do a count(*) in a call sql query ??

Thanks a lot.
Bye

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to