Arrghh.... it is that simple. Never occurred to me to try this with an INSERT. 
Thanks. :-)

Guido

On Mon, 16 Feb 2015 08:39:22 -0500 (EST)
Jason Dolan <ja...@pcc.com> wrote:

> It should be as simple as:
> 
> QSqlQuery query;
> query.prepare("INSERT INTO rooms (coordinate) VALUES 
> (ST_SetSRID(ST_MakePoint(:lon, :lat), 4326)) returning id”);
> query.bindValue(“:lon”, x);
> query.bindValue(“:lat”, y);
> uint roomsId = 0;
> if(query.exec() && query.first())
>       roomsId = query.value(0).toUInt();

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to