Thread View: comp.databases.ms-sqlserver
2 messages
2 total messages
Started by Thomas
Wed, 14 Jul 1999 00:00
HELP-----Insert into
Author: Thomas
Date: Wed, 14 Jul 1999 00:00
Date: Wed, 14 Jul 1999 00:00
34 lines
1378 bytes
1378 bytes
Hello
I have a problem whit insert into and I have try this
and get this error massage
Ncorrect syntax near the keyword 'values'
I uses Delphi3 and sql server 7.0
what have I done wong?
please help
procedure TForm1.Button1Click(Sender: TObject);
begin
with th do
begin
try
Close;
SQL.Clear;
SQL.Add(Format('Insert Into
Shippers(Values(%s,%d)',['Thomas',12345]));
Prepare;
ExecSQL;
Except
On Exception do
raise;
end; {try-except}
end; {with}
end;
:-) Thomas
Re: HELP-----Insert into
Author: Lewis Bruck
Date: Wed, 14 Jul 1999 00:00
Date: Wed, 14 Jul 1999 00:00
41 lines
1560 bytes
1560 bytes
The SQL should read "Insert Into Shippers Values (%s, %d)". You don't need
parentheses around the values clause. With the parentheses it is trying to
interpret what is enclosed as a list of column names...
Thomas wrote in message <7mh1db$oh7$1@news.inet.tele.dk>...
>Hello
>
>I have a problem whit insert into and I have try this
>and get this error massage
>
>Ncorrect syntax near the keyword 'values'
>I uses Delphi3 and sql server 7.0
>
>what have I done wong?
>please help
>
>
>procedure TForm1.Button1Click(Sender: TObject);
>begin
>with th do
> begin
> try
> Close;
> SQL.Clear;
> SQL.Add(Format('Insert Into
>Shippers(Values(%s,%d)',['Thomas',12345]));
> Prepare;
> ExecSQL;
> Except
> On Exception do
> raise;
> end; {try-except}
> end; {with}
>
>end;
>
>
>
>:-) Thomas
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads