Page 1 of 1

First Steps with PostgreSQL fail

Posted: Mon Oct 30, 2006 6:37 am
by bauer40
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.... :cry:

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?

Re: First Steps with PostgreSQL fail

Posted: Mon Oct 30, 2006 2:49 pm
by marielle
"Update failed on the SQL command: UPDATE testtab SET the_char = :1 where id = '1'
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.
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');
You have
* 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

Posted: Thu Nov 02, 2006 10:53 am
by bauer40
marielle wrote: ... but you have a ' after the 1... that's probably the problem.
Marielle
You're right - and not.
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.