Thanks for your reply, I will have a look at your code now.
My sites are a variable, but X,Y,Z are fixed (they are different types of accidents, and the data stored represents the number of occurances)
Just incase anybody want to have a go here is a create script
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Example](
[Site] [nvarchar](50) COLLATE Latin1_General_CI_AS NOT NULL,
[X] [int] NOT NULL,
[Y] [int] NOT NULL,
[Z] [int] NOT NULL
) ON [PRIMARY]
insert into Example(Site, X,Y,Z) Values ('A',1,2,3)
insert into Example(Site, X,Y,Z) Values ('B',4,5,6)
insert into Example(Site, X,Y,Z) Values ('C',7,8,9)
I've to check the database for existency. i.e. My table has a field called name. I've to check whether a particular string is present in the field. e.g I've to check whether "ratha" is prsent in name. I'm using SQLite. How to do this? Which Query should I use?
If I use LIKE key word,it doesn't fully serve my purpose. This is my query:
irr::core::stringc test = "Select name from profile WHERE name LIKE '%";
test += str.trim();
test += "%'";
result = pManager->SQLdb.Query(test);
With this query, I can't add a new name "sri" to the name field if "srinivasan" is already present in the name field. I don't want this. If "srinivasan" is present, I could not add names like "srinivasan","SRINIVASAN" or "SrInIvAsAn". i.e I've to check the exact name without regard to case. How to do this?
Another question is:
I've to restrict the number of records in a table. i.e I don't want to update the table if it already has 10 records in it. How to do this?