pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedBound column and serial datatype question
4+ messages / 3 participants
[nested] [flat]
* Bound column and serial datatype question
@ 2005-04-19 10:52 lothar.behrens@lollisoft.de
2005-04-23 06:57 ` Re: Bound column and serial datatype question Marko Ristola <marko.ristola@kolumbus.fi>
2005-04-23 17:55 ` Re: Bound column and serial datatype question lothar.behrens@lollisoft.de
0 siblings, 2 replies; 4+ messages in thread
From: lothar.behrens@lollisoft.de @ 2005-04-19 10:52 UTC (permalink / raw)
To: pgsql-odbc
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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Bound column and serial datatype question
2005-04-19 10:52 Bound column and serial datatype question lothar.behrens@lollisoft.de
@ 2005-04-23 06:57 ` Marko Ristola <marko.ristola@kolumbus.fi>
1 sibling, 0 replies; 4+ messages in thread
From: Marko Ristola @ 2005-04-23 06:57 UTC (permalink / raw)
To: pgsql-odbc
If you remove the NOT NULL definition from the CustomerNr,
you can put there a NULL value too.
The SQL email list is better for these questions, because they have
more knoledge of these kinds of problems ...
(The CustomerNr and ID columns seem to have redundant information.)
Regards,
Marko Ristola
lothar.behrens@lollisoft.de wrote:
>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
>
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Bound column and serial datatype question
2005-04-19 10:52 Bound column and serial datatype question lothar.behrens@lollisoft.de
@ 2005-04-23 17:55 ` lothar.behrens@lollisoft.de
1 sibling, 0 replies; 4+ messages in thread
From: lothar.behrens@lollisoft.de @ 2005-04-23 17:55 UTC (permalink / raw)
To: pgsql-odbc
Am 23 Apr 2005 um 9:57 hat Marko Ristola geschrieben:
I have solved the problem by shortly unbind the affected column.
The problem, that will stay, is that I do not know, how to detect such
a column by an ODBC call like SQLDescribeCol.
Lothar
>
> If you remove the NOT NULL definition from the CustomerNr,
> you can put there a NULL value too.
>
> The SQL email list is better for these questions, because they have
> more knoledge of these kinds of problems ...
>
> (The CustomerNr and ID columns seem to have redundant information.)
>
> Regards,
> Marko Ristola
>
> lothar.behrens@lollisoft.de wrote:
>
> >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
> >
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
--
Lothar Behrens www.lollisoft.de
Rosmarinstr 3 My public project:
40235 Düsseldorf http://sourceforge.net/projects/lbdmf
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Bound column and serial datatype question
@ 2005-04-19 13:24 Philippe Lang <philippe.lang@attiksystem.ch>
0 siblings, 0 replies; 4+ messages in thread
From: Philippe Lang @ 2005-04-19 13:24 UTC (permalink / raw)
To: lothar.behrens@lollisoft.de; 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@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] De la part de lothar.behrens@lollisoft.de
Envoyé : mardi, 19. avril 2005 12:52
À : pgsql-odbc@postgresql.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
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-04-23 17:55 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-19 10:52 Bound column and serial datatype question lothar.behrens@lollisoft.de
2005-04-23 06:57 ` Marko Ristola <marko.ristola@kolumbus.fi>
2005-04-23 17:55 ` lothar.behrens@lollisoft.de
2005-04-19 13:24 Re: Bound column and serial datatype question Philippe Lang <philippe.lang@attiksystem.ch>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox