FibPlus Script component set

for InterBase, Firebird and Yaffil

(recomended by Devrace).

version 1.9, date last change 02.05.2007

FIBPlus Script. Why do you need it?
===================================
If you develop database applications you need to create and execute special SQL-scripts. This enables you to simplify deployment and product support modifying and updating metadata in your customer's databases.

FIBPlus components executes DDL statements as well as common SQL-commands and you can improve your applications with such feature as built-in metadata updates. However, FIBPlus components do not execute SQL-scripts. You can not execute a few different SQL statements at once with TpFIBQuery or TpFIBDataSet. Both components can operate with single SQL statements only.

That's why I had to write my own script component set compatible with FIBPlus. It is compatible with IBX TIBScript, TIBExtract, but unlike the IBX component, it also supports "execute procedure", "create or alter", "describe" (as in IBExpert) etc. FIBPlus Script is used in several commercial applications with success, example "ATS Tarifficator", Blazetop

Download
============
Delphi 6:
Download fibscript_trial.zip (dcu for Delphi 6 UpdatePack2 and FibPlus 5.3)
Download fibscript_trial_d6_fib625.zip (dcu for Delphi 6 UpdatePack2 and FibPlus 6.25)
Download fibscript_trial_d6_fib64.zip (dcu for Delphi 6 UpdatePack2 and FibPlus 6.4)
Download fibscript_trial_d6_fib641.zip (dcu for Delphi 6 UpdatePack2 and FibPlus 6.4.1)
Download fibscript_trial_d6_fib65.zip (dcu for Delphi 6 UpdatePack2 and FibPlus 6.5) - Last Version
Delphi 7
:
Download fibscript_trial_d7_fib53sp1.zip (dcu for Delphi 7 (Build 4.453) and FibPlus 5.3SP1)
Download fibscript_trial_d7_fib61.zip (dcu for Delphi 7 (Build 4.453) and FibPlus 6.1)
Download fibscript_trial_d7_fib64.zip (dcu for Delphi 7 (Build 4.453) and FibPlus 6.4)
Download fibscript_trial_d7_fib641.zip (dcu for Delphi 7 (Build 4.453) and FibPlus 6.4.1)

Terms of use
============
This is not a freeware product. You can get a free trial version of FIBPlus Script, but after the evaluation period you should either purchase the component or remove it from you computer. Purchasing FIBPlus Script you get full sources of the product.

The price is $30 USD. It is normally quicker and easier to order online through well-known Internet payment services ShareIt and RegSoft. Their secure servers make ordering by credit/debit card quick and safe. They also accept purchase orders and faxed orders.

Purchase on-line via Regsoft or ShareIt:
Regsoft: http://www.regsoft.net/purchase.php3?productid=67119
ShareIt: http://www.shareit.com/product.html?cart=1&productid=204433&languageid=1&stylefrom=204433

Main FIBPlus Script features
============================
Supports all DDL-statements: DECLARE, ALTER, CREATE, etc.
Supports database connection/disconnection commands.
Supports transaction management commands: START TRANSACTION, COMMIT, etc
Supports new Firebird 1.5 and InterBase 7.x SQL.
Does not require SET TERM command to separate ALTER TRIGGER and ALTER PROCEDURE statements.
Support IBExpert command: DESCRIBE and SET BLOBFILE.

Script Example
==============

DECLARE EXTERNAL FUNCTION TIMETOSECONDS
TIME
RETURNS INTEGER BY VALUE
ENTRY_POINT 'TimeToSeconds' MODULE_NAME 'nntudf';

update products set price = 0 where id_price>60;

ALTER PROCEDURE SP_GET_ROUNDMINUTES (
DURATION TIME)
RETURNS (
DURATION_ROUNDMINUTES INTEGER)
AS
declare variable duration_hour integer;
declare variable duration_minute integer;
declare variable duration_second integer;
declare variable dontusefirstseconds integer;
BEGIN
select Z(extract(hour from :duration)), Z(extract(minute from :duration)),
Z(extract(second from :duration))
from rdb$database
into :duration_hour, :duration_minute, :duration_second;
SUSPEND;
END ;
=========

How to use FIBPlus Script in Delphi
===================================
Drop the component on a form and fill DataBase and Transaction properties. You can also use LastDDLQueryLog and LastDMLQueryLog properties (set the paths to text files to have a log of all DDL and
DML statements and errors). It will help you to find problem commands in your scripts, if any.

If you'd like to use FIBPlus Script component with FIBPlus 4.x or 5.0, you should move the RemoveDatabase method of TFIBDatabase (FIBDatabase.pas ) to public section and recompile the library.

Example:

FIBScript1.Script.LoadFromFile('c:\test.sql');
FIBScript1.AutoDDL := False;
if FIBScript1.ValidateScript then FIBScript1.ExecuteScript;
if FIBScript1.Transaction.InTransaction then FIBScript1.Transaction.Commit;

Copyright (c) Nikolay Trifonov, 2003-2007
E-mail: t_nick@mail.ru, t_nick@atstariff.com