Icon View Incident Report

Serious Serious
Reported By: Shane Sturgeon
Reported On: 2/26/2011
For: Version 2.05 Build 3
# 3388 Unknown Parameter Types Not Being Assigned Properly from Passed Parameter Values

I can't get the following procedure to work (with a parameter), and I can't figure out what on earth I am doing wrong. Can you point me in the right direction please.

If I run it a below, it works. When I swap the ''5'' for a ''?'' though (or ") it fails.

Original:

CREATE PROCEDURE "OffsetDate" (IN "Days" VARCHAR COLLATE UNI)
BEGIN    
  DECLARE Stmt STATEMENT;
  PREPARE Stmt FROM
    'UPDATE LogEntry
     SET
       logStart = logStart + ?,
       logFinish = logFinish + ?
     WHERE keyLog = ''{9B3D0505-E9F5-4B9A-B322-C78BC654EDA8}''';
  EXECUTE Stmt USING Days, Days;
END

Fixed:

CREATE PROCEDURE "OffsetDate" (IN "Days" VARCHAR COLLATE UNI)
BEGIN    
  DECLARE Stmt STATEMENT;
  PREPARE Stmt FROM
    'UPDATE LogEntry
     SET
       logStart = logStart + CAST(? AS INTERVAL DAY),
       logFinish = logFinish + CAST(? AS INTERVAL DAY)
     WHERE keyLog = ''{9B3D0505-E9F5-4B9A-B322-C78BC654EDA8}''';
  EXECUTE Stmt USING Days, Days;
END



Comments Comments
The problem was two-fold:

1) Data types of some parameters cannot be automatically determined by EDB, and will require a CAST() call to force a specific parameter data type.

2) EDB had a bug whereby it wasn't properly assigning the data type of the parameter by using the passed parameter value.


Resolution Resolution
Fixed Problem on 2/27/2011 in version 2.05 build 4


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB PHP Standard
ElevateDB PHP Standard with Source
ElevateDB PHP Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image