Page 1 of 1

Default value error with schema

Posted: Sat 24 Nov 2012 20:10
by Tomasz Andrzejewski
Hello,

If I create table for specific schema (different from dbo) on MSSQL Server wit default value I get error due post e.g

Code: Select all

CREATE SCHEMA [hub]
GO

CREATE TABLE [hub].[Test](
  TestId int not null identity(1,1),
  Name [nvarchar](100),
  CreateDate datetime not null default getdate()
)
GO
and now delphi code:

Code: Select all

procedure TForm.ButtonClick(Sender: TObject);
var
  UniQuery1: TUniQuery;
begin
  UniQuery1 := TUniQuery.Create(Self);
  try
    UniQuery1.Connection := UniConnection;
    UniQuery1.SQL.Add('select * from [hub].[Test] where 1 = 0');
    UniQuery1.Options.DefaultValues := True;
    UniQuery1.Open;
    UniQuery1.Append;
    UniQuery1.FieldByName('Name').Value := 'some data';
    UniQuery1.Post;
  finally
    FreeAndNil(UniQuery1);
  end;
end;
If I use ADOConnection and ADOQuery from dbGO there is no error.

Re: Default value error with schema

Posted: Mon 26 Nov 2012 10:10
by AndreyZ
Thank you for the information. We have reproduced and fixed this problem. This fix will be included in the next UniDAC build.