Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] what am i supposed to do when i want to run insert query and i need to know id of that row ?

[DiscordArchive] what am i supposed to do when i want to run insert query and i need to know id of that row ?

[DiscordArchive] what am i supposed to do when i want to run insert query and i need to know id of that row ?

rektbyfaith
Administrator
0
11-25-2023, 08:35 PM
#1
Archived author: Rymercyble • Posted: 2023-11-25T20:35:15.817000+00:00
Original source

what am i supposed to do when i want to run insert query and i need to know id of that row ?
rektbyfaith
11-25-2023, 08:35 PM #1

Archived author: Rymercyble • Posted: 2023-11-25T20:35:15.817000+00:00
Original source

what am i supposed to do when i want to run insert query and i need to know id of that row ?

rektbyfaith
Administrator
0
11-25-2023, 09:18 PM
#2
Archived author: Young Toto • Posted: 2023-11-25T21:18:50.333000+00:00
Original source

The id of the row you just inserted? I know python has a function to get that, not sure about cpp
rektbyfaith
11-25-2023, 09:18 PM #2

Archived author: Young Toto • Posted: 2023-11-25T21:18:50.333000+00:00
Original source

The id of the row you just inserted? I know python has a function to get that, not sure about cpp

rektbyfaith
Administrator
0
11-25-2023, 09:19 PM
#3
Archived author: Young Toto • Posted: 2023-11-25T21:19:18.348000+00:00
Original source

Worst case, you can select all, order by the id in descending order, and limit the select to 1 row
rektbyfaith
11-25-2023, 09:19 PM #3

Archived author: Young Toto • Posted: 2023-11-25T21:19:18.348000+00:00
Original source

Worst case, you can select all, order by the id in descending order, and limit the select to 1 row

rektbyfaith
Administrator
0
11-25-2023, 09:19 PM
#4
Archived author: Young Toto • Posted: 2023-11-25T21:19:56.810000+00:00
Original source

Assuming its autoincrement
rektbyfaith
11-25-2023, 09:19 PM #4

Archived author: Young Toto • Posted: 2023-11-25T21:19:56.810000+00:00
Original source

Assuming its autoincrement

rektbyfaith
Administrator
0
11-25-2023, 09:25 PM
#5
Archived author: Honey • Posted: 2023-11-25T21:25:46.348000+00:00
Original source

You probably want to let the core know all existing IDs and let it decide the next ID for your insert query.
rektbyfaith
11-25-2023, 09:25 PM #5

Archived author: Honey • Posted: 2023-11-25T21:25:46.348000+00:00
Original source

You probably want to let the core know all existing IDs and let it decide the next ID for your insert query.

rektbyfaith
Administrator
0
11-25-2023, 09:28 PM
#6
Archived author: Roboto • Posted: 2023-11-25T21:28:51.692000+00:00
Original source

<https://dev.mysql.com/doc/c-api/8.0/en/mysql-insert-id.html>
Not sure if it's exposed by the db abstraction layers in the core though
rektbyfaith
11-25-2023, 09:28 PM #6

Archived author: Roboto • Posted: 2023-11-25T21:28:51.692000+00:00
Original source

<https://dev.mysql.com/doc/c-api/8.0/en/mysql-insert-id.html>
Not sure if it's exposed by the db abstraction layers in the core though

rektbyfaith
Administrator
0
11-25-2023, 10:53 PM
#7
Archived author: Rymercyble • Posted: 2023-11-25T22:53:44.973000+00:00
Original source

i dont think so
rektbyfaith
11-25-2023, 10:53 PM #7

Archived author: Rymercyble • Posted: 2023-11-25T22:53:44.973000+00:00
Original source

i dont think so

rektbyfaith
Administrator
0
11-25-2023, 10:54 PM
#8
Archived author: Rymercyble • Posted: 2023-11-25T22:54:06.410000+00:00
Original source

currently im using 2 queries i mean it works but its quite pepega
rektbyfaith
11-25-2023, 10:54 PM #8

Archived author: Rymercyble • Posted: 2023-11-25T22:54:06.410000+00:00
Original source

currently im using 2 queries i mean it works but its quite pepega

rektbyfaith
Administrator
0
11-25-2023, 10:55 PM
#9
Archived author: Rymercyble • Posted: 2023-11-25T22:55:27.873000+00:00
Original source

that would be just overcomplicated solution i dont need that for this table its just for initial setup when character is logged in first time
rektbyfaith
11-25-2023, 10:55 PM #9

Archived author: Rymercyble • Posted: 2023-11-25T22:55:27.873000+00:00
Original source

that would be just overcomplicated solution i dont need that for this table its just for initial setup when character is logged in first time

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)