Error in insert with ADOCommand

0

In Delphi XE4, SQL Server 12, connected by ADOConnect .

ADOCommand1.commandText being 'insert into tabela (a,b,c) (1,1,1)'

Works as expected if a record already exists. But if it is the first record the message appears:

  

"An empty line can not be inserted, the line must have at least one   column value set "

Despite the message, the record is included, checked by a subsequent query.

    
asked by anonymous 04.05.2014 / 14:03

2 answers

1

Syntax is incorrect

It would be so

SQL.ADD('insert into tabela (a,b,c) VALUES (1,1,1)');
    
28.07.2014 / 16:10
-2

Do not miss the reserved word INTO?

insert into table (a, b, c) INTO (1,1,1)

    
12.05.2014 / 15:52