"cannot convert type 13"

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sean
Posts: 42
Joined: Sun 16 Jul 2006 00:17

"cannot convert type 13"

Post by sean » Sat 14 May 2011 16:48

Hi,

I have a SP with two in and one OUT param that was working fine.

After copying the SP to a new one and adding a second out parameter, the error ""cannot convert type 13" pops up.

Working SP:
CREATE PROCEDURE `p_weightper1000`(IN priceid INT, IN verbose INT, OUT weightper1000 DOUBLE) ...

Problem SP:
CREATE PROCEDURE `p_price`(IN priceid INT, IN verbose INT, OUT notes char(255), OUT price DOUBLE) ....

Can a second OUT parameter not be handled?

MyDac V5.90.0.60 for D7

Update:
--------
further analysis indicates the second out parameter is not the issue.
As the end of the SP there is a:
select @notes, price;
if this is replaced by
select substring(@notes,500), price;
then there is no problem.

The string is actually about 50 characters, but limited to any vlaue, 50. 100 or 1000, causes the error to disappear.

Seems like a bug?

On the delphi side side, the results of the select are handled as follows:

Execute; // calll SP
while Active do begin // read debug output, if any
while not EOF do begin
s := '';
if debugon=1 then begin
for i := 0 to Fields.Count - 1 do
s := s + Fields.FieldName + '= ' + Fields.AsString + #13#10;
meDebug.Lines.Add(s);
end;
Next;
end;
OpenNext;
end;

AndreyZ

Post by AndreyZ » Mon 16 May 2011 11:45

Hello,

When you are using the @ symbol, MySQL server returns fields as BLOB fields. To solve the problem, you should change SQL code in your stored procedure from

Code: Select all

select @notes, price;
to

Code: Select all

select notes, price;

Post Reply