UniDAC 6.2.8/DB2 - AV when subsequent stored proc executes if SP has CLOB output parameter

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dJabber
Posts: 3
Joined: Thu 26 Sep 2013 10:43

UniDAC 6.2.8/DB2 - AV when subsequent stored proc executes if SP has CLOB output parameter

Post by dJabber » Tue 03 Nov 2015 08:21

Hello.
Database - IBM DB2 LUW 10.5

Reproducing steps
1. Create DB2 SP with CLOB output parameter like this:

Code: Select all

CREATE OR REPLACE PROCEDURE NFTG.TEST_PROC (
    IN ID	INTEGER,
    OUT DOCUMENT_NAME	VARCHAR(510),
    OUT DOCUMENT_DATE	TIMESTAMP,
    OUT DOCUMENT_TYPE	INTEGER,
    OUT DOCUMENT_DIRECTION	INTEGER,
    OUT DOC_TYPE_TEXT	VARCHAR(128),
    OUT DOC_DIRECTION_TEXT	VARCHAR(128),
    OUT COMMENT	CLOB(2047M) )
  SPECIFIC SQL151103102315059
  LANGUAGE SQL
  NOT DETERMINISTIC
  EXTERNAL ACTION
  MODIFIES SQL DATA
  CALLED ON NULL INPUT
  INHERIT SPECIAL REGISTERS
  OLD SAVEPOINT LEVEL
begin
  set (DOCUMENT_NAME, DOCUMENT_DATE, DOCUMENT_TYPE, DOCUMENT_DIRECTION, 
       DOC_TYPE_TEXT, DOC_DIRECTION_TEXT, COMMENT)=
      ('ЙЙЙЦЦЦУУУ','05.11.2015',1,1,'копия паспорта','входящий','');
end;
2. Put connection on the VCL form, then put TUniStoredProc and a button.
3. Implement button.OnClick handler like this:

Code: Select all

procedure TForm8.btn1Click(Sender: TObject);
var
  s1 : string;
  d3 : TDateTime;
  i4 : integer;
  i5 : integer;
  s6 : string;
  s7 : string;
begin
    for p in sp.Params do  //workaround of case, I wrote in topic
                         //http://forums.devart.com/viewtopic.php?f=28&t=32561
    begin
      param:=p as TUniParam;
      if param.ParamType=ptOutput then
      begin
        param.ParamType:=ptInputOutput;
      end;
    end;

    sp.ParamByName('id').AsInteger := 4;

    sp.ExecProc();
    sp.ExecProc(); //    <-- access violation here
end;
4.Execute application and press the button - the exception message appears.

I'm wondering, what should I do in this situation. May be there are some workarounds...

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: UniDAC 6.2.8/DB2 - AV when subsequent stored proc executes if SP has CLOB output parameter

Post by MaximG » Wed 04 Nov 2015 11:10

Thank you for the information. We have reproduced the issue, and we will inform you about the results shortly.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: UniDAC 6.2.8/DB2 - AV when subsequent stored proc executes if SP has CLOB output parameter

Post by MaximG » Tue 08 Dec 2015 09:10

We have already fixed the error, and the fix will be included in the next build. The new build will be released by the end of the week or in the early next week.

Post Reply