Subject Re: [IBO] IB_SQL Script limit 64K
Author Marco Menardi <mmenaz@lycosmail.com>
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 09:00 AM 22/01/2003 +0000, you wrote:
> >Hi, I can't enter long scripts in IB_SQL script form.
> >I've noticed that tha form (in IBF_Script) uses a TRichEdit, that has
> >a limit in the maximum lines allowed, while TMemo seems not (I've
> >tested both in a form, side by side, pasting a very long script. In
> >TRichEdit was truncated, in TMemo was not).
> >Is there any reason to use TRichEdit instead of TMemo?
> >If not it must be changed.
>
> Must?
>

Yes, must :) Why use a component that does not work instead of one
that works? Why on earth you prefer having a limit without ANY gain in
other aspects? I'm not english, and if "must" sounds rough change with
a better expression, but I'm sure you have got what I mean :)

> > If I want to run a script to build the database, it's too big for
> > TRichEdit.
> > Using IBO 4.2Ib, Win2K, D6.
>
> 64K is too long for one script. It will make it very hard to
> maintain. Also, I know there is an upper limit on the size of
script which
> ISQL will handle - I think it is probably lower than 64K. 40K seems to
> ring a bell...but a 40K script is too big for practical purposes as
well.
>
> It is good practice to run a series of scripts, e.g.
> Script0: create the database, declare exceptions, domains, udfs and
create
> generators.
>
> Script1: declare tables and primary keys.
>
> Script2: triggers
>
> Script3: foreign keys, indexes
>
> Script4: stored procedures. I often do two scripts for SPs - one
for the
> lower-level procs, the next for the top-level ones.
>
> Script5: DML script for populating control tables.
>
> Script7: Drops, alters and recreates.
>

THIS solution is very hard to mantein! And you will get crazy for
dependencies when your table declaration or SP or Triggers or both
exceed 64K limits.
If I have to add a default to a field, I simply export metadata, edit
the script, then rebuild the database, and finally import the data
(IBPump). That's very easy and error free.


> If you want to end up with this running as if it were one script,
include
> an INPUT statement at the end of each script (except the last, of
course).
>
> This sequence will take good care of most dependency situations but
you can
> vary your content and your includes to suit your specific database.
>
> Helen

INPUT? I will check FB documentation, thanks :)
Marco Menardi