remedial mysql???

Dr. Hawkins dochawk at gmail.com
Sat Aug 18 17:37:53 EDT 2012


On Sat, Aug 18, 2012 at 2:08 PM, Peter Haworth <pete at lcsql.com> wrote:
>
> On Sat, Aug 18, 2012 at 1:05 PM, Dr. Hawkins <dochawk at gmail.com> wrote:

> >
> > I'm not seeing that in the 5.5.1 dictionary for revExecuteSQL (or
> > revDataFromQuery, for that matter).  Am I looking in the wrong place?
> >
>
> From the dictionary entry for revExecuteSQL:
>
> "The SQLStatement is a string <dictionary/keyword/1541.xml> in Structured
> Query Language <glossary/s/461.xml>. (Do not include a semicolon at the
end
> of the SQLStatement.)"

OK, i finally found it.  I had to paste it  into openoffice to successfully
search, but . . .

> >
> > And while I'm asking such things, how can Livecode even *have* a
> > requirement here--shouldn't it be just passing the command to the
database?
> >
>
> Ours not to reason why, ours just to do as mother ship instructs :-)  Have
> you tried it without the semicolons?

Yes, with & without semicolons; with & without begin/end.  But here's a new
message:


I've fired up again, and now, with a command of
BEGIN
ALTER TABLE dna  ADD disp BOOLEAN
ALTER TABLE dna  ADD cont CHAR(1)
ALTER TABLE dna  ADD coDbt CHAR(1)
COMMIT


I get

You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'ALTER TABLE
dna  ADD disp BOOLEAN
ALTER TABLE dna  ADD cont CHAR(1)
ALTER TABLE ' at line 2


> > I'm trying to cut the lag from a remote db by batching those commands I
can
> > (there was really no reason for these to be individual queries in the
first
> > place, other than that there will only be one or two of them typically,
> > save when opening a new client "file", in which case there will be
dozens")
>
>
> OK, if you are doing multiple ALTER TABLE statements, then yes, wrap them
> in START/COMMIT.  I thought you were only executing one since that is what
> was in your original example.  But you still need to use revExecuteSQL;
> revDataFromQuery is for returning columns from a SELECT statement.

It will successfully execute just about any one-line command, it appears;
I've been using it for the individual ALTER and so forth for some time.


> I'm curious as to why you need to add all these columns to an existing
> table.  I assume your database must be customizable according to the
> clients' needs?

There are about 200 judicial districts in the US, all with somewhat
different requirements. Then there are the add-ons packages for chapter 13
and what-have-you, and certainly custom features.

As I have it set up, if a new field appears, whether for one of these, or
because I added a feature, it automatically gets added to the database, and
its contents swept to/from the db.

Also helpful during development, when I realize, "Oh, I also need a . . ."

The feature actually traces back to the original 1989 HyperCard prototype,
when used to dump data for mailmerge.
'thanks



--
The Hawkins Law Firm
Richard E. Hawkins, Esq.
(702) 508-8462
HawkinsLawFirm at gmail.com
3025 S. Maryland Parkway
Suite A
Las Vegas, NV  89109



More information about the Use-livecode mailing list