Hi, i have a problem with CREATE PROCEDURE statement:
ZSQLProcessor.Script.Clear;
ZSQLProcessor.Script.Add('CREATE PROCEDURE NPOD_INSERT ( PODIME VARCHAR(50) ) RETURNS ( PODID DOUBLE PRECISION ) AS BEGIN PODID = GEN_ID(GEN_PODID,1); INSERT INTO NPOD (PODID,PODIME) VALUES (:PODID,:PODIME); SUSPEND; END^');
TRY
ZSQLProcessor.Execute;
EXCEPT Raise End;
which component can i use to create procedures, trigers, tables ... at runtime ?
thanks!
TZSQLProcessor
Moderators: gto, cipto_kh, EgonHugeist
thank you for replay
but i cant understand how to create stored procedure at runtime yet
statement: CREATE PROCEDURE NPOD_INSERT ( PODIME VARCHAR(50) ) RETURNS ( PODID DOUBLE PRECISION ) AS BEGIN PODID = GEN_ID(GEN_PODID,1); INSERT INTO NPOD (PODID,PODIME) VALUES (:PODID,:PODIME); SUSPEND; END^
on which component can put this statement and NOT receive an error ? i think that with the trigers will be the same...
thanks!
but i cant understand how to create stored procedure at runtime yet
statement: CREATE PROCEDURE NPOD_INSERT ( PODIME VARCHAR(50) ) RETURNS ( PODID DOUBLE PRECISION ) AS BEGIN PODID = GEN_ID(GEN_PODID,1); INSERT INTO NPOD (PODID,PODIME) VALUES (:PODID,:PODIME); SUSPEND; END^
on which component can put this statement and NOT receive an error ? i think that with the trigers will be the same...
thanks!
-
- Expert Boarder
- Posts: 164
- Joined: 18.03.2008, 13:03
- Contact:
emils,
please try something like that:
It works with postgresql, so I guess it will work for firebird too.
please try something like that:
Code: Select all
ZConnection1.Connect;
ZConnection1.ExecuteDirect('CREATE DATABASE jt_test;') ;
ZConnection1.Disconnect;