Problem to connect Stored Procedure with Crystal (1 Viewer)

JohnyMoraes

New member
Local time
Today, 05:19
Joined
Apr 6, 2011
Messages
3
Good Morning.

When i try to add one Stored Procedure in Crystal Reports, show me the error about parameters:

"Incorrect number of arguments for PROCEDURE sp_ChequesDevolvidos; expected 2; got 0;"

the stored is:

Code:
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_ChequesDevolvidos`(vDataInicio date, vDataFim date)
BEGIN
       *
       *SELECT SEMANA_CADASTRADOS, 
              *  QTD_CADASTRADOS, 
              *  SOMA_CADASTRADOS,
              *  SEMANA_DEVOLVIDOS,
              *  QTD_DEVOLVIDOS,
              *  SOMA_DEVOLVIDOS 
       *FROM
          (
          SELECT WEEK(CHEQUE_DTCADASTRO) as 'SEMANA_CADASTRADOS', 
                  COUNT(*) as 'QTD_CADASTRADOS', 
                  SUM(CHEQUE_VALOR) as 'SOMA_CADASTRADOS'
          FROM cheques
          WHERE CHEQUE_DTCADASTRO BETWEEN vDataInicio AND vDataFim
          GROUP BY WEEK(CHEQUE_DTCADASTRO)
          )c left join 
          (
          SELECT WEEK(CHEQUE_DTDEVOLUCAO) as 'SEMANA_DEVOLVIDOS', 
                  COUNT(*) as 'QTD_DEVOLVIDOS',
                  SUM(CHEQUE_VALOR) as 'SOMA_DEVOLVIDOS'
          FROM cheques
          WHERE CHEQUE_DTDEVOLUCAO BETWEEN vDataInicio AND vDataFim
          GROUP BY WEEK(CHEQUE_DTDEVOLUCAO)
          )a
          on c.SEMANA_CADASTRADOS = a.SEMANA_DEVOLVIDOS;          
END;


Someone know how i find a solution for this ?
I use Crystal Reports 8.5 and MySql.
 

kevlray

Registered User.
Local time
Today, 05:19
Joined
Apr 5, 2010
Messages
1,046
I did not know that you could create a stored procedure from CR. CR is designed to have only read only access.

On the flip side. Since you are just using SQL code, the error should be coming from the SQL processor for MySQL.

I hope this helps.
 

JohnyMoraes

New member
Local time
Today, 05:19
Joined
Apr 6, 2011
Messages
3
I create the stored in MySql and try to add it in Crystal.
But occur the error related when I add.

I read some things that when you add a stored in Crystal Reports, he automatically create the parameters of the stored in the crystal reports. But when i try, occur this error =/

I don't know if this can occur because of MySql or because other factor.
 

kevlray

Registered User.
Local time
Today, 05:19
Joined
Apr 5, 2010
Messages
1,046
Unfortunately I am not an MySQL expert (a lot better with MS-SQL). Secondarly, it has been years since I used CR 8.5 for developing. Crystal has changed so much (especially in the data connection area) since then. I wish I give you more help.
 

JohnyMoraes

New member
Local time
Today, 05:19
Joined
Apr 6, 2011
Messages
3
I solve this problem!
I instal the driver Mysql odbc 5.1.8 and fixed the problem.

Thanks for the help, kevlray
 

Users who are viewing this thread

Top Bottom