Help regarding databse & variable management
Hello, I have a problem in database connectivity in Zope with Postgres. If anybody can help me in this regard please reply asap. I want to insert a row into a tabel, get a unique id from the table and make another entry into another table.I am able to insert into the forst table and retrieve the unique ID. But while trying to insert into the next table, it says no value for the unique id retireved. Expecting a solution. Reagrds, George __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
On Sat, 7 Apr 2001, [iso-8859-1] Honey George wrote:
Hello, I have a problem in database connectivity in Zope with Postgres. If anybody can help me in this regard please reply asap.
I want to insert a row into a tabel, get a unique id from the table and make another entry into another table.I am able to insert into the forst table and retrieve the unique ID. But while trying to insert into the next table, it says no value for the unique id retireved.
Expecting a solution.
Reagrds, George
To reiterate: You have two tables: CREATE TABLE A (id SERIAL, name TEXT); CREATE TABLE B (id INT, name TEXT); You're able to insert the first table: ZSQL Method: INSERT_A: INSERT INTO A (name) VALUES ('foo'); and retrieve the unique value: ZSQL Method: GET_LAST_A: SELECT currval('A_id_seq'); (or maybe you say something like SELECT max(id) FROM A, though the above is faster & safer) and you want to insert into the second table with that retrieved value: ZSQL Method: INSERT_B: INSERT INTO B (id, name) VALUES ( <dtml-var value_of_A >, 'foo'); and it 'says no value for the unique id retrieved' ? Where does it say this? Are sure you're passing the retrieved last value to your GET_LAST_A. It would help to post your ZSQL methods and your controlling DTML method. -- Joel Burton <jburton@scw.org> Director of Information Systems, Support Center of Washington
Please do not crosspost questions like this to either zope-dev or zope-checkins. Thanks! - C ----- Original Message ----- From: "Honey George" <honey_george@yahoo.com> To: <zope@zope.org> Cc: <zope-dev@zope.org>; <zope-checkins@zope.org> Sent: Saturday, April 07, 2001 5:46 PM Subject: [Zope] Help regarding databse & variable management
Hello, I have a problem in database connectivity in Zope with Postgres. If anybody can help me in this regard please reply asap.
I want to insert a row into a tabel, get a unique id from the table and make another entry into another table.I am able to insert into the forst table and retrieve the unique ID. But while trying to insert into the next table, it says no value for the unique id retireved.
Expecting a solution.
Reagrds, George
__________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Chris McDonough -
Honey George -
Joel Burton