Guid issue with Actian ZEN

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mika
Posts: 20
Joined: Thu 08 May 2014 06:15

Guid issue with Actian ZEN

Post by mika » Fri 15 Apr 2022 08:12

Hi,
I can't assign guid parameter .asguid, I have to pass guid as string and remove {} from string. Following example demostrates this

Code: Select all

var
  c:tuniconnection;
  uq: TUniQuery;
  g: TGUID;
begin
  c := TUniConnection.Create(nil);
  c.ProviderName := 'ODBC';
  c.server := 'Driver=Pervasive ODBC Unicode Interface;dbq=kirkar;ServerName=mylaptop';
  c.LoginPrompt := FALSE;
  c.Connected := true;
  uq := tuniquery.Create(nil);
  uq.connection := c;
  uq.sql.text := 'drop table if exists guidtest ';
  uq.execsql;
  uq.SQL.Text := 'create table guidtest (g uniqueidentifier not null default newid(), text varchar(100), primary key(g))';
  uq.ExecSQL;
  uq.SQL.Text := 'insert into guidtest (text) values (''hello there'') ';
  uq.ExecSQL;
  uq.SQL.Text := 'select * from guidtest';
  uq.open;
  g := uq.FieldByName('g').AsGuid;
  uq.Close;
  uq.SQL.Text := 'update guidtest set text = :p1 where g= :p2';
  uq.ParamByName('p1').AsString := 'will this work?';
  uq.ParamByName('p2').AsGuid:= g;
  uq.ExecSQL;
  codesite.send('uq.rowsaffected', uq.rowsaffected);
  uq.ParamByName('p1').AsString := 'how about this, will this work?';
  uq.ParamByName('p2').asstring:= copy(g.ToString,2,36); // remove { }
  uq.ExecSQL;
  codesite.send('uq.rowsaffected', uq.rowsaffected);
Ouput of codesite is

Code: Select all

uq.rowsaffected = 0
uq.rowsaffected = 1
Actians own string presentation of guid is without {}
I there anything I can do or do I just have to tell my team to use asstring?

pavelpd
Devart Team
Posts: 109
Joined: Thu 06 Jan 2022 14:16

Re: Guid issue with Actian ZEN

Post by pavelpd » Mon 23 May 2022 13:30

Hi!

Thank you for the information.
We have reproduced the issue and will investigate its origin.
We will inform you about the results shortly.

mika
Posts: 20
Joined: Thu 08 May 2014 06:15

Re: Guid issue with Actian ZEN

Post by mika » Tue 31 May 2022 08:01

Thank you.
I'm waiting for fix. We have somehow managed to use string presentation but working with 3rd part libraries which relay on UniDac makes upgrading hard. Have to patch that library and check that everyone in team makes that :)

Jeremy123
Posts: 2
Joined: Fri 22 Jul 2022 06:27

Re: Guid issue with Actian ZEN

Post by Jeremy123 » Mon 25 Jul 2022 07:24

Hi!

Thank you for the information.
top concrete

Post Reply