on 05-11-2022 11:54 AM
I have a question related to mysql and crystalreport.
There is a MySQL stored procedure created in MySQL dB that have 2 IN parameters as varchar(20) for startdate and enddate(in procedure, it is converted to date type value with str_to_date).
In Crystal Report it is the report with two parameters as string type startdate and enddate
When I use this procedure from command of the report as:
call MyProcedure('{?startdate}','{?enddate}');
it returns error :
"Failed to retrieve data from the database.
Details :HY000:[MySQL][ODBC 5.1
Driver][mysqld-5.7.33-0ubuntu0.16.04.1-log]Incorrect datetime value:''
for function str_to_date [Database Vendor Code 1411]"
if I use fixed values, no parameter values, as :
call MyProcedure('01/01/2022','05/01/2022');
it works and returns values in report.
When parameters are prompted to be sent they are written as in fixed version.
Has crystal report some problems with mysql stored procedures to call it?
What is the solution to such issue?
Create a new report and select the SP, fil in the dates and then look in the Show SQL, it may show you the format CR is passing.
Then look in the Command window by Show Command in the Connection properties, you should see the 2 parameters listed. Likely cause is the ? in the parameter of the Command.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Problem was that report was modified, first time it refer to MSSQL dB then to a MySQL dB and first command was deleted and then added second command in which call to procedure was made , it seems that such modifications made some internal problems.
When a new report was made, from the start connected to MySQL dB, and was added a command with call to MySQL procedure it worked.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.