BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQL and fieldname "No"

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Gerhard Fischer
Guest





PostPosted: Wed Apr 07, 2004 7:23 am    Post subject: SQL and fieldname "No" Reply with quote



Hello,

we work with CPP-Builder6, TQuery and SQL-Statements to an an ACESS2000
database. In a table (Tabelle1) of this database there is a field with the
fieldname "No".

Now the statement

DELETE * FROM Tabelle1 WHERE No >100

didn`t work. The count of RowsAffected was always 0 and the datarecords
were really not deleted. When we changed the fieldname from "No" to another
name, for example "NoField", the delete-statement

DELETE * FROM Tabelle1 WHERE NoField >100

was okay and the datarecords were really deleted.

Could it be that "No" is a "keyword" in SQL ? Sorry, but I am no specialist
in SQL.


Gerhard


Back to top
Viatcheslav V. Vassiliev
Guest





PostPosted: Wed Apr 07, 2004 8:47 am    Post subject: Re: SQL and fieldname "No" Reply with quote



Yes, it could be. And it is a good style to always use brackets for
column/table names:

DELETE * FROM [Tabelle1] WHERE [No] > 100

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Gerhard Fischer" <xxxx (AT) xxxx-gmbh (DOT) de> сообщил/сообщила в новостях следующее:
news:4073ac2e (AT) newsgroups (DOT) borland.com...
Quote:
Hello,

we work with CPP-Builder6, TQuery and SQL-Statements to an an ACESS2000
database. In a table (Tabelle1) of this database there is a field with
the
fieldname "No".

Now the statement

DELETE * FROM Tabelle1 WHERE No >100

didn`t work. The count of RowsAffected was always 0 and the datarecords
were really not deleted. When we changed the fieldname from "No" to
another
name, for example "NoField", the delete-statement

DELETE * FROM Tabelle1 WHERE NoField >100

was okay and the datarecords were really deleted.

Could it be that "No" is a "keyword" in SQL ? Sorry, but I am no
specialist
in SQL.


Gerhard





Back to top
Gerhard Fischer
Guest





PostPosted: Wed Apr 07, 2004 9:28 am    Post subject: Re: SQL and fieldname "No" Reply with quote



Thank you for the help. With the brackets now it works !

Gerhard

"Viatcheslav V. Vassiliev" <support (AT) oledbdirect (DOT) com> schrieb im Newsbeitrag
news:4073c043 (AT) newsgroups (DOT) borland.com...
Quote:
Yes, it could be. And it is a good style to always use brackets for
column/table names:

DELETE * FROM [Tabelle1] WHERE [No] > 100

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Gerhard Fischer" <xxxx (AT) xxxx-gmbh (DOT) de> сообщил/сообщила в новостях
следующее:
news:4073ac2e (AT) newsgroups (DOT) borland.com...
Hello,

we work with CPP-Builder6, TQuery and SQL-Statements to an an ACESS2000
database. In a table (Tabelle1) of this database there is a field with
the
fieldname "No".

Now the statement

DELETE * FROM Tabelle1 WHERE No >100

didn`t work. The count of RowsAffected was always 0 and the datarecords
were really not deleted. When we changed the fieldname from "No" to
another
name, for example "NoField", the delete-statement

DELETE * FROM Tabelle1 WHERE NoField >100

was okay and the datarecords were really deleted.

Could it be that "No" is a "keyword" in SQL ? Sorry, but I am no
specialist
in SQL.


Gerhard







Back to top
Jerry Bloomfield (TeamB)
Guest





PostPosted: Thu Apr 08, 2004 12:54 am    Post subject: Re: SQL and fieldname "No" Reply with quote

On Wed, 7 Apr 2004 09:23:24 +0200, "Gerhard Fischer" <xxxx (AT) xxxx-gmbh (DOT) de>
wrote:

Quote:
Could it be that "No" is a "keyword" in SQL ? Sorry, but I am no specialist
in SQL.

I looked at the section in the "Local SQL" Help file and "NO" is in there,
so that explains why you can't use it. The "Local SQL" help file is very
good for general SQL questions like yours.

Jerry Bloomfield (TeamB)
--
http://www.teamb.com [email]JersWork (AT) iwc (DOT) net[/email]
Please do *NOT* send private e-mail without prior permission (my anti-spam
filters will probably just delete it anyway <g>)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.