Joost van der Sluis ha scritto:
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)

Sorry but debug is a little hard for me... the program is a linux service and I never debugged it, when I have a problem I just put some "text-file-logging" around in the code.
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
Ok, so the auto-commit can't be the problem cause I'm using mysql 4.0.20.

I read the bugtracker at the link... Just for completion, I write you that the linux-service I'm doing have several threads inside it, however actually the class it's using it it's not used by a thread but by a class (a tcp/ip device that generates query events when send/receive something).

Just to say... actually with your component I'm doing 7 queryes each one of 5-10 rows involving 5 to 8 tables in 37 milliseconds (amazing).
And the mysql server is not localhost.

So it seems to work VERY well; I just have a problem with that damn last_insert_id.

If you have other ideas (after you look at the code) or if you need some more code, just write me.

Thanks again,
Alvise

Joost

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




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

Reply via email to