Bulk DDL Statements from script

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
cytrinox
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 26.11.2008, 09:48

Bulk DDL Statements from script

Post by cytrinox »

Hi,

I have a script which contains all CREATE statements for my views, procedures and indicies.

This script is an export from IBExpert (Firebird 2.0 DB). That's not a special format, it's just a list of multiline CREATE statements:

Code: Select all

SET TERM ^ ;
CREATE PROCEDURE FOOO....
BEGIN
 ........
END^

CREATE PROCEDURE ...
How can I execute this script on the database via ZEOS?

TZSQLProcessor throws an exception: Incorrect token followed by ":".

That only happens if the script contains CREATE PROCEDURE statements. Firebird uses the following syntax to insert data into the result columns of a procedure: SELECT a, b, c FROM FOO INTO :a, :b, :c.

This is a very huge script which must be offen updated, exported and included as ressoure in my projects, so the best way would be a solution which does not require a rewrite of the script (different TERM symbols, escapes, ...)

I think the main problem is that ZEOS tries to parse the sql script which doesn't make sense in my case. Is it possible to send the complete script directly to the database via Zeos?
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

Without looking your procedure it is difficult to say what is the problem, but trying with this procedure

SET TERM ^ ;
CREATE PROCEDURE PROCEDURE3 (
P1 Integer )
RETURNS (
R1 Integer )
AS
DECLARE VARIABLE
myVAR integer;

BEGIN
SELECT a.C_ID
FROM CARGO a into myvar;
R1 = myvar;
SUSPEND;
END^
SET TERM ; ^

and TSQLProcessor works as expected. Changing myVar to :myVar
it returns the ':' error, but FlameRobin too returns the same error, so I think ':' char cannot be use in a procedure
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Setting the ParamCheck property to false might help as well.

Mark
Image
Post Reply