Op dinsdag 16-10-2007 om 10:45 uur [tijdzone +0200], schreef Alvise
Nicoletti:
> John ha scritto:
> > Alvise Nicoletti wrote:
> >> Hi... this is the complete code I'm using to extract the 
> >> last_insert_id from the table TABLE1, but it still don't works.
> >> Infact I get always 0 from the variable "id_ingresso", pheraphs in 
> >> the database the row is correctly inserted.
> >>
> > Hi Alvise,
> >
> > I haven't gone through you example completely, but try doing the same
> > thing by generating the sql text on the fly instead of using
> > parameters.  I was unable to get anything to work using parameters when
> > I last tried a few months ago.
> >
> > cheers,
> > John
> >
> > _________________________________________________________________
> >     To unsubscribe: mail [EMAIL PROTECTED] with
> >                "unsubscribe" as the Subject
> >   archives at http://www.lazarus.freepascal.org/mailarchives
> >
> >
> >
> I tryed but that wasn't the problem... With delphi+zeoslib the (nearly) 
> same code works, so I suppose I found some kind of bug...
> How can I debug this?

Compile fcl-db with debuginfo. If you use Lazarus, you can simply add
fpcsrc/packages/fcl-db/sqldb and fpcsrc/packages/fcl-db/sqldb/mysql to
your project-sources path.

Or you can do a 'make clean all OPT='-gl' install' in
fpcsrc/packages/fcl-db. But then you have to take care that the
generated .ppu files are installed into the right paths. (On windows
this is mostly not the case)

> I tryed, as you see in the code, to handle the transaction like if it's 
> only one block of operations...
> ... Maybe there is an implicit commit after the query execution that I 
> don't know how to remove?

I haven't debugged your code yet, but sqldb doesn't support transactions
at all for mysql (As mysql < 5 doesn't do so either) So it  doesn't do
any commits. As you've set parsesql to false, it also doesn't do any
extra queries, do I think it should work.

For a real solution you should have take a look at
http://www.freepascal.org/mantis/view.php?id=9758

Joost

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

Reply via email to