Icon View Incident Report

Minor Minor
Reported By: Tim Young
Reported On: 3/17/2008
For: Version 1.08 Build 1
# 2566 Out Parameters in a Script or Stored Procedure Not Being Assigned Properly in USING Clause

When an IN/OUT or OUT parameter is further used as an IN/OUT or OUT parameter in an EXECUTE statement with the USING clause within the script or stored procedure, the value from the EXECUTE statement is not being assigned properly.

CREATE PROCEDURE "InsertDocument" (OUT "DocumentID" INTEGER, IN "SiteID" INTEGER,
                                   IN "TypeID" INTEGER, IN "DocDate" DATE,
                                   IN "DateReceived" DATE,
                                   IN "Title" VARCHAR COLLATE ANSI,
                                   IN "Author" VARCHAR COLLATE ANSI,
                                   IN "Recipient" VARCHAR COLLATE ANSI,
                                   IN "StatusID" INTEGER)
BEGIN
  DECLARE Stmt STATEMENT;
  DECLARE TempCursor SENSITIVE CURSOR FOR CursorStmt;

  PREPARE Stmt FROM 'INSERT INTO Documents (DocumentID, TypeID, Date, DateReceived,
Title, Author, Recipient, StatusID) VALUES (?, ?, ?, ?, ?, ?, ?, ?)';

  EXECUTE Stmt USING DocumentID, TypeID, DocDate, DateReceived, Title, Author,
Recipient, StatusID;

  UNPREPARE Stmt;

  -- Now DocumentID should contain the next document ID

  PREPARE CursorStmt FROM 'SELECT * FROM Document2Site WHERE
(DocumentID = ?) AND (SiteID = ?)';

  OPEN TempCursor USING DocumentID, SiteID;

  IF ROWCOUNT(TempCursor) = 0 THEN

     INSERT INTO TempCursor (DocumentID, SiteID) VALUES (DocumentID, SiteID);

  END IF;
END



Resolution Resolution
Fixed Problem on 3/18/2009 in version 1.09 build 1


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 VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image