lazarus/examples/database/tsqlscript
maxim 2eec396f95 Examples, database/tsqlscript: fixed typo
git-svn-id: trunk@45906 -
2014-07-18 00:04:49 +00:00
..
dbconfig.pas
dbconfiggui.lfm
dbconfiggui.pas
mainform.lfm Examples; TSQLScript: 2014-06-19 10:02:00 +00:00
mainform.pas Examples, database/tsqlscript: fixed typo 2014-07-18 00:04:49 +00:00
readme.txt Examples; TSQLScript: 2014-06-19 10:02:00 +00:00
sqldbtutorial0.ini
tsqlscriptsample.lpi Examples; TSQLScript: 2014-06-19 10:02:00 +00:00
tsqlscriptsample.lpr
tsqlscriptsample.res

TSQLScript
==========

This directory shows how to use TSQLScript to run a batch of SQL statements.

TSQLScript can be used to run multiple SQL statements - terminated by ; - after each other.
It is provided by FPC's SQLDB database layer and available in Lazarus.

Notes:
- You must/should have created an empty database on your server/embedded database system first. The scripts will try to create tables and insert sample data. You can also load your own SQL script or paste it in the memo.
- FPC 2.6.x versions currently have a bug that prevents running statements with : in them (e.g. Firebird stored procedure creation). FPC trunk/development version revision 26112 has fixed this, and it may be backported to 2.6.x; please check release notes and documentation.
- Firebird DDL (e.g. table creation) and DML (e.g. inserting data) must be separated by a COMMIT. This may also apply to other databases. FPC bug 17829 tracks this, but FPC 2.6.x or trunk currently contains no fix.
A workaround is to split the script into 2, see the sample program.
- The logon form is taken from SQLdb_Tutorial3.

Incidentally, it sets up a database with tables and sample data for the Lazarus wiki tutorials:
http://wiki.lazarus.freepascal.org/SQLdb_Tutorial0
http://wiki.lazarus.freepascal.org/SQLdb_Tutorial1
http://wiki.lazarus.freepascal.org/SQLdb_Tutorial2
http://wiki.lazarus.freepascal.org/SQLdb_Tutorial3
http://wiki.lazarus.freepascal.org/LazReport_Tutorial

Please see the SQLdb_Tutorial0 article for instructions and requirements.
(You'll need database clients and a sample database; see the article)