Forums Register Login

sql auto increment question

+Pie Number of slices to send: Send
hello,

im using sql 4.0 and i have created a table that has a field book_id which is a primary key and,integer with auto increment.How can i insert a new book?tried but still cant figure how to make auto increment work.

thnx in advance!!
+Pie Number of slices to send: Send
You don't need to insert id, insert rest of the details.
+Pie Number of slices to send: Send
It would be easier to advise if we knew what you had already tried. But the general idea is to leave the book-id column out of your INSERT statement and let the database generate the key value.
+Pie Number of slices to send: Send
so for me to understand a simple example:

insert into books(every field exept book_id) values(every value exept book_id)

is this right??
thnx alot!!
+Pie Number of slices to send: Send
Aris,
Yes, that is correct. The database takes care of the one field you left out.
New rule: no elephants at the chess tournament. Tiny ads are still okay.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1007 times.
Similar Threads
Java DB - Reset auto-increment primary key
is it a must to have id for each mapping file ?
Pb with auto-increment field
autoincrement invoice
Primary key generated as 5000000000006877 when generator class used is native
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:04:13.