Page 1 of 1

Bulk DDL Statements from script

Posted: 17.02.2009, 15:26
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?

Posted: 19.02.2009, 13:52
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

Posted: 25.02.2009, 10:53
by mdaems
Setting the ParamCheck property to false might help as well.

Mark