Understanding component UniQuery

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cointec
Posts: 50
Joined: Fri 11 Dec 2015 11:02

Understanding component UniQuery

Post by cointec » Mon 14 Dec 2015 22:01

Hello, I'm testing Unidac. I have made a simple application to query one table. I use Uniquery.

SQL = select * from TableX
SQLInsert = insert into TableX, not all fields.

When I try to execute an insert, I get an exception of (FieldX is required), but FieldX is not part of the insert statement.

What do I have to take into account with this components for such operation?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Understanding component UniQuery

Post by AlexP » Wed 16 Dec 2015 10:04

Hello,

We can't reproduce the problem. The below code works with no errors. Please modify the code, so that the error is reproduced. In addition, specify the database you are working with.

Code: Select all

  UniConnection1.ExecSQL('CREATE TABLE DEPT (DEPTNO INTEGER NOT NULL, DNAME VARCHAR(14), LOC VARCHAR(13), PRIMARY KEY (DEPTNO))');
  UniQuery1.SQL.Text := 'Select * from dept';
  UniQuery1.SQLInsert.Text := 'INSERT INTO DEPT(DEPTNO) values(:DEPTNO)';
  UniQuery1.Open;
  UniQuery1.Append;
  UniQuery1.FieldByName('deptno').AsInteger := 1;
  UniQuery1.Post;

Post Reply