mehdi_h Report post Posted 07/19/2009 01:36 AM Hi I'm using a DB query module to retrieve values from mysql database. When passing a basic "select * from members", the module works fine .But when passing the following sql query: "select members.clientid,count(*) as nbr from result left join members on members.clientid=result.clientid where (connexion=1) group by members.clientid order by nbr asc;" The DB query module does not work and I have the follwing error logged: 112753.781 23 1 ERROR v7.0.3415.28902 (2009-05-08 15:03:23.86) ConnectAndRun_AdoNetFactory : Le cast spécifié n'est pas valide. 112753.781 23 1 oVgmDbQuery_AdoNetCommon_Completed SqlQueryType=ERROR, RowsCount=0 112753.781 23 1 oVgmDbQuery_AdoNetCommon_Completed strError=Le cast spécifié n'est pas valide. 112753.781 23 1 path {Le cast spécifié n'est pas valide.} not found 112753.781 23 1 path {ERROR} not found 112753.781 23 1 path {error} not found 112753.796 23 1 HangupCall, source=oVgmDbQuery_AdoNetCommon_Completed ERROR, WorkModeScript=Running_Normal, yLineStateAppPov=[Connected], lPlayId=0, lRecId=0 112753.796 23 1 ScriptState set Stopping, (called from HangupCall) 112753.796 23 1 ls set Disconnect_Pending 112753.796 23 1 state Hanging up... [oVgmDbQuery_AdoNetCommon_Completed ERROR] 112753.796 23 1 rv add [Hangup Source]{oVgmDbQuery_AdoNetCommon_Completed ERROR} 112753.796 23 1 GoOnHoook_IssueDropCall start (crn=20000001) NB: this query works fine using phpmyadmin any adea? Tkx Mh Share this post Link to post
SupportTeam Report post Posted 07/19/2009 11:07 AM Does the SQL work if you remove the count(*) portion of the expression? Share this post Link to post
mehdi_h Report post Posted 07/21/2009 05:21 PM Indeed when removing the count there is no more error. So seems that there is an issue withe that query Mh Share this post Link to post
SupportTeam Report post Posted 07/21/2009 10:57 PM The DB Query module creates an $RV which gives you the count of the retrieved entries. Not sure though if in this case that $RV will hold the value that you want. Share this post Link to post
mehdi_h Report post Posted 07/22/2009 12:10 AM I have found a work around. I just create a view that executes my query, then I call the view with a basic "select * from view" so that VG module is not confused ;-) tkx Share this post Link to post
SupportTeam Report post Posted 07/22/2009 03:54 AM The query in the Database Query module is just passed as is (after $RV substitution) to the ADO.NET data provider. The error that you were seeing was returned by MySQL's ADO.NET data provider, not by VoiceGuide. Share this post Link to post