On Friday 17 March 2006 02:44, Joost van der Sluis wrote:
> > I think I have now discovered the error in updating the data on the
> > postgres database. The sqlquery is passing a bad string to the postgres
> > database engine. In my case the the following is passed:
> > Update arcust set custno = 'BRS', company = 'Blue Ribbon Stairs' where
> > (custno=BRS)
> >
> > Notice that the BRS lacks single quotes. It should be (custno='BRS').
>
> Can you add a bug-report for this here
> http://www.freepascal.org/bugs/add.php3
>
> Else I might forget to fix it.
>
> > The append works - the insert statement was perfect.
>
> In the mean time, define a numerical field as the primary key. It's
> quite uncommon to use a string-field as the primary key.
>
> Joost
Thank you for your help in this matter. Now that someone has taken the time
to explain the workings of the SQLdb I think I understand. I will transfer
my knowledge to the wiki. It has been years since I have had such a learning
experience. I had to learn how to turn on a postgres log (only 10 mintues).
But the real fun was reading so many Delphi articles. In reflection I think
not one article applies to Lazarus. Maybe Pascal in general.
BTW:
The reason I used char as the data type of the primary key was because all the
tables have the OID turned on. A OID is a self regulating field
(serial,sequence). So I thought I was avoiding the requirement of using
"nextval()" for inserts. Also as a primary key using the char for custno
solved the user issues of trying to remember numbers instead of strings.
'BRS123' is an easy lookup for 'Blue Ribbon Stairs' for example verus
'123897' and faster that typing 'Blue Ribbon Stairs'. I could also use the
serial data type as a column with similar results.
I hope the bug will be fixed very soon. I, of course need it. You might want
to look at the blob issue too.
John
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives