Question: I can't insert a value using this code:

```
 insert into t_category_values (CategoryCode,
 CategoryValueCode, CategoryValue) values(2, 1, 1);

```

error msg

```
no primary key

```

Answer: 
Your query is wrong it should be:

```
INSERT INTO `DBA`.`t_category_values` 
(CategoryCode, CategoryValueCode, CategoryValue)
VALUES(1, 1, "aaa");

```

See here for more help: [Sql Insert Wiki](http://en.wikipedia.org/wiki/Insert_%28SQL%29)

---

**Edit:**

Your query and error:

> 
> insert into t\_category\_values
>  (CategoryCode, CategoryValueCode,
>  CategoryValue) values(2, 1, 1); 
> 
> 
> no primary key
> 
> 
> 

In insert while specifying to insert in few column instead of all in table you must have to include primary key. That means in your one of CategoryCode, CategoryValueCode, CategoryValue should be primary key or include fourth column that is primary key in table.
You are getting the error "No Primary Key" because you have not specified a valid unique primary key. 

Your table must be 4 columns. 

```
INSERT INTO t_category_values (PRIMARY_KEY, CategoryCode, CategoryValueCode, CategoryValue) 
VALUES(pkey_value_here, 2, 1, 1);

```

The only time you dont need to specify the primary key column is when the primary key is an auto increment value. If it is an auto increment column the INSERT will automatically fill in that value for you and you dont need to worry about it.