|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Im using PERL DBI ..
i have on field in my table "HV" called ---> id integer(11) PRIMARY KEY AUTO_INCREMENT , name varchar(25) ---> Now i wanna insert values into table ... what is the SQL statement i have to use for inserting values .. ---> INSERT INTO HV values ( ????? ,"name"); ---> im using MySQL 3.22.27... thanks in advance vijay |
|
#2
|
||||
|
||||
|
id integer(11) PRIMARY KEY AUTO_INCREMENT , name varchar(25) ---> you can use a create statement like following for auto_increment field. create table tablename(id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,name varchar(25)); ---> INSERT INTO HV values ( ????? ,"name"); ---> In insert statement you can't add values to an auto increment field.just you can skip that field.it will automatically insert that number. INSERT INTO HV(name)values("name"); ------------------ SR - webshiju.com "The fear of the LORD is the beginning of knowledge..." |
|
#3
|
|||
|
|||
|
Thank you very much ... it is working well and fine ... vijay |
|
#4
|
|||
|
|||
|
Thank you very much ... it is working well and fine ... vijay |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > AUTO_INCREMENT HOWTO? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|