Page 1 of 1

Guid issue with Actian ZEN

Posted: Fri 15 Apr 2022 08:12
by mika
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?

Re: Guid issue with Actian ZEN

Posted: Mon 23 May 2022 13:30
by pavelpd
Hi!

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

Re: Guid issue with Actian ZEN

Posted: Tue 31 May 2022 08:01
by mika
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 :)

Re: Guid issue with Actian ZEN

Posted: Mon 25 Jul 2022 07:24
by Jeremy123
Hi!

Thank you for the information.
top concrete