Criteria for Identity?

Hi,
I’m not getting an identity returned after inserting a record.

My ID field is a uuid (created from a custom formatter). It’s database field is user_id (in this instance). After insert I have a single query to retrieve the user just created by identity. The database insert is created fine.

How does Wappler know the identity column to return and is there something in the insert above that stops it from being able to retrieve it?

Thanks!

It is different in all databases, there is no standard for it. We still having problems with postgres to get the inserted id back. Could you tell us which Server Language (PHP, ASP or .NET) you are using and which Database Server.

I’m using PHP and the Database is MS SQL Server.

In PHP PDO::lastInsertId (https://www.php.net/manual/en/pdo.lastinsertid.php) is used, this normally works for each supported database. If somehow the build-in method doesn’t work, in MS SQL you can get the last identity with SELECT @@IDENTITY, you could create a custom query directly after the insert query to retrieve it.