I use a "INSERT INTO ... VALUES .... RETURNING ID" query , on a postgresql server, with LiveCode (version 5.5.3 and version 6.1) and the native postgresql driver for revOpenDatabase.
With revdb_execute or revExecuteSQL... LiveCode doesn't receive back the id... although the record is correctly created into the database.
I receive only a "0".
Do you have any idea ?
Postgresql : problem with INSERT... RETURNING
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Postgresql : problem with INSERT... RETURNING
I'm baffled !
The query is working fine with... revDataFromQuery !
The ID created by Postgresql is correctly returned in myResult.
I always thought that revDataFromQuery was for SELECT queries !
Anyway... I found the hint on this thread :
http://runtime-revolution.278305.n4.nab ... 64759.html
The query is working fine with... revDataFromQuery !
Code: Select all
put revDataFromQuery(,,gID,dbSQL) into myResult
I always thought that revDataFromQuery was for SELECT queries !
Anyway... I found the hint on this thread :
http://runtime-revolution.278305.n4.nab ... 64759.html
Re: Postgresql : problem with INSERT... RETURNING
Returning 0 on successful insert? Functional bug. Reports go here: http://quality.runrev.com (example stacks or full solutions to see problem should ideally be attached)
revdatafromquery working with insert? interesting. In theory one could argue that this is a documentation bug, but in fact the dictionary does not really say that only select is allowed
(Could be clearer about that tho)
As a side note, I'd argue that revdb_execute is supposed to be deprecated, but that's probably just me being picky.
revdatafromquery working with insert? interesting. In theory one could argue that this is a documentation bug, but in fact the dictionary does not really say that only select is allowed

As a side note, I'd argue that revdb_execute is supposed to be deprecated, but that's probably just me being picky.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode