On Thu, 2006-10-05 at 17:19 -0400, Adrian Maier 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). "
> > >
> > > Enabling the statement logging in postgres doesn't help in this case,
> > > because the
> > > sql command is not recognised at all, and therefore it doesn't show
> > > up in the log.
>
> > It's more then 132 characters long, so it should be in the log?
> The size is not important. I meant that i've configured postgres to
> write in the log
> all the queries that are executed, for debugging. Yet, the query
> which generates
> the error is not recognized as a query at all, and only the error
> appears in the
> log.
Can't you specify to log all the commands which are sent?
> > Since it's with applyupdates. The SQL is probably parsed incorrectly.
> > You can look what the updatequery.sql, modifyquery.sql etc. are. Maybe
> > that that already reviels the problem.
>
> I'm afraid that i still don't understand how can I see those queries.
> What/where
> are the update.sql, modifyquery.sql that you are referring to?
Seems that they aren't public.
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...
Joost
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives