Even the first basic steps creating a stack to display and edit information stored in a Postgres database fail.
RunRev-Version: 2.7.4 Build 291 on WinXP with most recent patches
Problem: when modifying values in the stack, the write back to the Postgres fails with an error message
"Update failed on the SQL command: UPDATE testtab SET the_char = :1 where id = '1'
Revdb error:"
That all. No more information on that error.
The stack is created very, very simple:
* New Mainstack
* Define Query with the query builder: select * from testtab; set the primary key
* Drag Text Entry Fields for each database field on the stack and link it with a field from the query; check the "update data after editing" check box.
* Drag Buttons for Prev, Next and Update to the stack and assign the appropriate action to it
* enter one record in the database; set the primary key value
* Run the stack and fail....
Database structure and contents:
CREATE TABLE testschema.testtab ( the_varchar varchar(10), the_char char(10), the_date date, the_float float4, id int4);
INSERT INTO testschema.testtab VALUES ('Peter','Bauer','24.12.2006',123.45,1');
Any idea what might go wrong?
First Steps with PostgreSQL fail
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
Re: First Steps with PostgreSQL fail
I don't use postgreSQL but I am used to MySQL. That kind of error pointing to a specific entry (here id=1) usually indicates a problem in the formatting of the data."Update failed on the SQL command: UPDATE testtab SET the_char = :1 where id = '1'
You haveCREATE TABLE testschema.testtab ( the_varchar varchar(10), the_char char(10), the_date date, the_float float4, id int4);
INSERT INTO testschema.testtab VALUES ('Peter','Bauer','24.12.2006',123.45,1');
* the_varchar varchar(10)
* the_char char(10)
* the_date date
* the_float float4,
* id int4
.... makes 5 parameters
* 'Peter'
* 'Bauer'
* '24.12.2006'
* 123.45
* 1'
makes 5... but you have a ' after the 1... that's probably the problem.
Marielle
Re: First Steps with PostgreSQL fail
You're right - and not.marielle wrote: ... but you have a ' after the 1... that's probably the problem.
Marielle
That ' was a typo which I made from on the pslq command line interface.
But youre answer gave me the idea to start with non-critical data types, and only one after each other.