bundling multiple database queries and getting a result

Dr. Hawkins dochawk at gmail.com
Sun Jun 2 10:28:14 EDT 2013


On Sun, Jun 2, 2013 at 5:43 AM, Mike Bonner <bonnmike at gmail.com> wrote:

>
> I've only tested this on sqlite.  No clue if it works with other dbms.
>


That seems to be the issue.  I may be hitting the same bug with postgres
that I've hit before.

I have a button with:

on mouseUp
   --code for a button showing the bug that doesn't allow multi-line
queries
   --    to a postgresql database

   --if the database is mysql, the queries work properly.
   --for postgres, the result is "revdberr," --just the one word; no
explanation
   local dcmd, theRes
   global dhtbl_dinfo, dhtbl_dna, debtordb
    put "BEGIN TRANSACTION;" & cr into dcmd
   put "SELECT * FROM " & dhtbl_dinfo & " WHERE kywd='dFirstName';" & cr
after dcmd
   put "SELECT * FROM " & dhtbl_dinfo & " WHERE kywd='dLastName';" & cr
after dcmd
   put "COMMIT" & cr after dcmd
   put revDataFromQuery(,,debtorDb,dcmd) into theRes
   put theRes
end mouseUp

This works with mysql, and returns the odd "revdberr," with postgres.

Yes, that *is* the entire returned error.

I've also seen this error after successful commits, and have had to code
around it.  This is the first time I've seen it occur other than in place
of a numeric success code, though.

I get the same results in 5.5.4 and 6.0.1 commercial.
-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462



More information about the use-livecode mailing list