Subject Re: [IBO] IB_SQL Dialect3 and ib_domain.sql
Author Helen Borrie (TeamIBO)
At 02:10 PM 10-06-02 +0000, you wrote:
>I'm new to IB.
>
>I'm porting a pdox level 7 to ib w/ib_sql & pdox2ib.
>
>I need 'Time' and 'TimeStamp,' so it appears I need
>dialect3.
>
>'pdox2ib_info.rtf' tells me to 'run the script
>named 'ib_domain.sql' from IB_SQL.
>
>I can only presume that 'run the script' =
>click the 'Execute Script' button and load the
>'ib_domain.sql' file, which I do.
>
>When my gdb file is specified as SQL Dialect 1,
>'Execute' in the Script window appears to run OK,
>but the 'Commit/Rollback' icons never appear active.

That's by design - the COMMITS are in the script.


>When my gdb file is specified as SQL Dialect 3,
>which is what I need, I believe, 'Execute' in the
>Script window returns an error, 'Token Unknown' on
>all the UDF functions.

Yes -oops - I wrote this utility for IB 5.6, which permitted double-quotes
on strings. It's allowed (but not recommended) for Dialect 1; but
definitely verboten for Dialect 3. Just go through and replace all the
double-quotes with singles.


>If I click 'Yes' on these errors for 'Continue
>Executing Script?', the Script statusbar returns
>the message 'Script completed without exceptions.'

A script is simply a batch file of SQL statements. By telling the
IB_Script component to carry on executing statements, it will just bypass
the one that causes the exception and continue executing statements. If it
gets through to the end, it assumes there were no exceptions. The best
thing to do when an exception occurs is to abort the script (respond 'No"
to "continue executing'), since the script has no way to know what
succeeded and what failed.

Generally, in DDL scripts, you would include SET AUTO which will
server-autocommit each DDL statement (but it doesn't act on DML statements
at all). So the idea of "rolling back" a script is restricted only to
scripts which neither commit nor autocommit.

In short, you probably don't have ANY of the domains created by the
ib-domain.sql script, but you probably DO have some of the triggers. After
altering the quotes, you can just run the script again. It will complain
whenever it encounters something that already existing - just answer 'Yes'
continue executing, and the missing pieces will get there.


>The 'Commit/Rollback' icons appear active only
>occasionally, as a result of processes or patterns
>which I cannot discern, but never when it seems
>relevant to my next step, according to 'pdox2ib_info.rtf.'

If the Commit icon appears live at all after the script completes, just
click it, to commit anything that is hanging around uncommitted. Rollback
(if available) won't rollback much, if anything at all, because there are
plenty of commits in the script.

>...and what are the 'Yield' and 'Store' checkboxes
>about, and do they have any relevance to what I'm
>attempting. Help gives no info I can find.

The script form in pdox2ib is a straight lift of the one used in
IB_SQL. Yield determines if an Application.ProcessMessages should be
called during execution. I'm not sure what Store does. I've never paid
attention to them at all, although I've run thousands of scripts through
IB_SQL. Certainly nothing in pdox2ib depends on them.


>These are apparently symptoms of my beginners angst,
>which perhaps a little more documentation might help.

You might like to read up the documentation for TIB_Script; but I doubt if
knowing more about how the component works would make any difference to the
task of converting your Paradox database. Unfortunately, this tool is
nothing but a slightly polished version of one I made for my own
purposes; except that, without the help of IBO, I used to have to jump in
and out of it and play with the scripts by hand. To a great extent, it's
still decidedly manual - it's in no way intended to be transparent to an IB
novice. I guess at least you need to know where you are going - understand
IB data types, generators, and so on. The purpose of the two sets of
domains (one for each dialect) is really to suggest likely data type
conversions based on what the BDE can extract from your Paradox
schema. There's no way it can teach you what you need to learn about IB.

There's nothing wrong with running it several times until you get a clearer
picture of where you are going. You can save the definitions on the way
through and run the schema conversion from the stored defs...and you don't
have to do all the tables in a single hit. You can keep playing with the
scripts until you have a schema that you are happy with and then do the
pumping step.

Anyway, thanks for being the guineapig for the domain script. I guess I'd
better fix up those quotes.

regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com