Skip site navigation (1) Skip section navigation (2)

Re: Bound column and serial datatype question

From: "Philippe Lang" <philippe(dot)lang(at)attiksystem(dot)ch>
To: <lothar(dot)behrens(at)lollisoft(dot)de>, <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Bound column and serial datatype question
Date: 2005-04-19 13:24:34
Message-ID: 6C0CF58A187DA5479245E0830AF84F4214323E@poweredge.attiksystem.ch (view raw or flat)
Thread:
Lists: pgsql-odbc
What about using a server-side function for doing your insert? This function can simply return the id of the inserted line, and on  the client-side, you open it? This is a very useful method for doing inserts. It allows you to do all kinds of initializations and sanity checks server-side. 

-----Message d'origine-----
De : pgsql-odbc-owner(at)postgresql(dot)org [mailto:pgsql-odbc-owner(at)postgresql(dot)org] De la part de lothar(dot)behrens(at)lollisoft(dot)de
Envoyé : mardi, 19. avril 2005 12:52
À : pgsql-odbc(at)postgresql(dot)org
Objet : [ODBC] Bound column and serial datatype question

Hi,

I have a table like this:

CREATE TABLE Kunden
(
  ID serial NOT NULL,
  CustomerNr serial NOT NULL,
  Name CHAR(100),
  ...
);

Using bound columns in a form to show the customer data I don´t like to let the user updating the CustomerNr field. This is because, a normal data field is not autogenerated, but these 'serial' data fields.

But I like to show the CustomerNr field in the form. Therefore, I simply made the field readonly in the form. But if I insert a new row, the fields data (defaults to 0) would be used as the new value in the table.

How to avoid this ?

Thanks

Lothar

--
Lothar Behrens		www.lollisoft.de
Rosmarinstr 3		My public project:
40235 Düsseldorf  	http://sourceforge.net/projects/lbdmf




---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



pgsql-odbc by date

Next:From: Peter BenseDate: 2005-04-19 17:01:49
Subject: ODBC and proxy server(s)??
Previous:From: Ben TrewernDate: 2005-04-19 12:40:23
Subject: Re: URGENT: schema mess

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group