On 10/6/06, Adrian Maier <[EMAIL PROTECTED]> wrote:
On 10/5/06, Joost van der Sluis <[EMAIL PROTECTED]> wrote:
> > > > I'm using Sqldb to access a PostgreSQL database.  Is it possible to 
find out
> > > > easily what sql commands is sqldb generating and trying to execute ?
> > > >
> > > > I have a DBgrid which is associated to a table.
> > > > After updating a row and executing query.ApplyUpdates  , the program 
generates
> > > > an exception :
> > > > "An error occurred while applying the updates in a query: preparation 
of query
> > > > failed. (PostgreSQL: ERROR: syntax error at end of input at character 132). 
"
> > > >
>
> What you could do: compile the sqldb-unit with debuginfo and place a
> breakpoint on line 1181. And then take a look at qry.sql.text. Or simply
> place a 'writeln(qry.sql.text);' on that line. Recompile fpc and try
> again...

I was hoping that recompiling sqldb wasn't neccessary .  But if there's no
other way ...


I have added some writelns inside pqconnection.pp just before the
PQexec calls.
The query that causes the error is :

' prepare prepst2 (int,int,numeric,text,int,text,int) as update PROD
set mag=$1,cod=$2,pu=$3,den=$4,p_vinz=$5,um=$6,stoc_ini=$7 where '

Which is incomplete...   It looks liek it wasn't able to detect the columns that
form the primary key.   This table has a PK made up of 3 columns.
Can sqldb handle multi-column primary keys ?


--
Adrian Maier

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to