insert-id Questions

15

Solved

I want to INSERT a record in a database (which is Microsoft SQL Server in my case) using JDBC in Java. At the same time, I want to obtain the insert ID. How can I achieve this using JDBC API?
Emotional asked 16/12, 2009 at 14:57

3

Solved

Is there an internal ID variable or timestamp I can use in a NSSortDescriptor to retrieve Core Data entities in the order they were inserted? I would rather not have to create such properties if t...
Magistrate asked 25/4, 2010 at 10:46

7

Solved

I have the following query: INSERT INTO table (a) VALUES (0) ON DUPLICATE KEY UPDATE a=1 I want the ID of either the insert or the update. Usually I run a second query in order to get this as I...
Dinnerware asked 22/4, 2009 at 18:22

6

Solved

I am trying to insert date and time into mysql datetime field. When a user select a date and time, it will generate two POST variables. I have searched internet but still not sure how to do it. M...
Angkor asked 28/5, 2010 at 14:56

1

Solved

I been programming 3~4 years ago, and I remember that in some 2005 php security book about the safety of using mysql_insert_id to retrieve the last_inser_id. In the book says that if there is seve...
Henrieta asked 23/10, 2013 at 20:42

4

Solved

How would I get the last inserted ID using a multirow insert? Here is my code: $sql='INSERT INTO t (col1, col2, col3) VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9)'; // example $stmt = $contactsTable-&gt...
Doublehung asked 19/1, 2010 at 14:15

4

Solved

is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. Howe...
Sharika asked 11/9, 2008 at 7:37

5

I'm trying to some something like that: INSERT INTO dir_pictures SET filename=CONCAT(picture_id,'-test'); picture_id is my primary key, auto-increment. Basically I'm trying to put the id of this...
Othilia asked 28/10, 2009 at 23:22
1

© 2022 - 2024 — McMap. All rights reserved.