Project

General

Profile

How to get Id in SQL?

Added by Fahmi Noorain almost 11 years ago

Hi, I've create a table with following query:

CREATE TABLE "User" (

"id" integer primary key autoincrement,

"version" integer not null,

"name" text not null,

"email" text not null,

"password" text not null,

"phone" text not null,

"imei" text not null,

"token" text not null,

"role" integer not null

);

And then run this code:

ptr userPtr = session.find().where("token = ? ").bind("123456");

But, how to get the id number from the result?


Replies (1)

RE: How to get Id in SQL? - Added by Rajeev Gajbhiye almost 11 years ago

I guess userPtr.id() is what you require.

You can refer this discussion http://redmine.webtoolkit.eu/boards/2/topics/3775. May be it will help.

Regards,

Rajeev.

    (1-1/1)