Why cant i exec this on zsqlprocessor or zquery
But i dont want to add sql.clear ; sql.sql := text;
parcial want to exec all on same string ???
any goodc
Better yet how can i exec create table create procedure and every thing on same tstring ?????
It it possible.
Execdirect solve the problem ???????
Damn this is a Terror movie .. .. .
/* Begin : Triggers Definition */
SET TERM ^ ;
CREATE TRIGGER TRI_GRUPOS FOR GRUPOS ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.GR_ID IS NULL) OR (NEW.GR_ID = 0)) THEN BEGIN NEW.GR_ID =GEN_ID(GEN_GRUPOSID ,1);END END ^
CREATE TRIGGER TRI_GRUPOSCOLABORDORES FOR GRUPOSCOLABORDORES ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.GC_ID IS NULL) OR (NEW.GC_ID = 0)) THEN BEGIN NEW.GC_ID =GEN_ID(GEN_GRUPOSCOLABORDORESID ,1);END END ^
CREATE TRIGGER TRI_FORMAPAGAMENTO FOR FORMAPAGAMENTO ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.FP_ID IS NULL) OR (NEW.FP_ID = 0)) THEN BEGIN NEW.FP_ID =GEN_ID(GEN_FORMAPAGAMENTOID ,1);END END ^
CREATE TRIGGER TRI_SERVICOSCLIENTES FOR SERVICOSCLIENTES ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.SC_ID IS NULL) OR (NEW.SC_ID = 0)) THEN BEGIN NEW.SC_ID =GEN_ID(GEN_SERVICOSCLIENTESID ,1);END END ^
CREATE TRIGGER TRI_SOLICITACOESCLICOL FOR SOLICITACOESCLICOL ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.SCC_ID IS NULL) OR (NEW.SCC_ID = 0)) THEN BEGIN NEW.SCC_ID =GEN_ID(GEN_SOLICITACOESCLICOLID ,1);END END ^
CREATE TRIGGER TRI_ATTACHFILES FOR ATTACHFILES ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.AF_ID IS NULL) OR (NEW.AF_ID = 0)) THEN BEGIN NEW.AF_ID =GEN_ID(GEN_ATTACHFILESID ,1);END END ^
CREATE TRIGGER TRI_SERVICOSCONTRATADOS FOR SERVICOSCONTRATADOS ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.SC_ID IS NULL) OR (NEW.SC_ID = 0)) THEN BEGIN NEW.SC_ID =GEN_ID(GEN_SERVICOSCONTRATADOSID ,1);END END ^
CREATE TRIGGER TRI_PERIODICIDADESERVICOS FOR PERIODICIDADESERVICOS ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.PS_ID IS NULL) OR (NEW.PS_ID = 0)) THEN BEGIN NEW.PS_ID =GEN_ID(GEN_PERIODICIDADESERVICOSID,1);END END ^
CREATE TRIGGER TRI_TIPOSERVICO FOR TIPOSERVICO ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.TS_ID IS NULL) OR (NEW.TS_ID = 0)) THEN BEGIN NEW.TS_ID =GEN_ID(GEN_TIPOSERVICOID ,1);END END ^
CREATE TRIGGER TRI_GENEROSERVICO FOR GENEROSERVICO ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.GS_ID IS NULL) OR (NEW.GS_ID = 0)) THEN BEGIN NEW.GS_ID =GEN_ID(GEN_GENEROSERVICOID ,1);END END ^
CREATE TRIGGER TRI_RESULTADO FOR RESULTADO ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.R_ID IS NULL) OR (NEW.R_ID = 0)) THEN BEGIN NEW.R_ID =GEN_ID(GEN_RESULTADOID ,1);END END ^
CREATE TRIGGER TRI_RESULTADO FOR ACCOESEXECUTADAS ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.AE_ID IS NULL) OR (NEW.AE_ID = 0)) THEN BEGIN NEW.AE_ID =GEN_ID(GEN_ACCOESEXECUTADASID ,1);END END ^
CREATE TRIGGER TRI_TIPOSOLICITACOESINFO FOR TIPOSOLICITACOESINFO ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.TSI_ID IS NULL) OR (NEW.TSI_ID = 0)) THEN BEGIN NEW.TSI_ID =GEN_ID(GEN_TIPOSOLICITACOESINFOID ,1);END END ^
COMMIT WORK ^
SET TERM ;^
/* End : Triggers Definition */
Zprocessor doesnt exec CREATE TRIGGER AND ZQUERY TO
Moderators: gto, cipto_kh, EgonHugeist
Zprocessor doesnt exec CREATE TRIGGER AND ZQUERY TO
where's the code ..
Error is just this
Error in Sql Statment ... I do this on a empty database after create tables and generators;
"
CREATE TRIGGER TRI_GRUPOS FOR GRUPOS ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.GR_ID IS NULL) OR (NEW.GR_ID = 0)) THEN BEGIN NEW.GR_ID =GEN_ID(GEN_GRUPOSID ,1);
"
On the 1st post is exacly what im using. Before this i have some code Create table but is ok.(I removed the CREATE TRIGGER SECTION and sql is executed.)
It just blocks on the 1st TRIGGER , on zsqlprocessor i added the "set term ^ ;"but didnt solve started and new error on "set term ^ ;" ...
So with "Set term ^" no error on "set term" but error continues on create trigger.
But i read a post i cant use trigger on zsqlprocessor and u gave a answer on in so i uses a zquery to the triggers
zsqlprcessor.execute;
zquery1.sql.text := is all trigger posted on 1st post ;
zquery1.execsql;
But doesnt work anyway,
do i have to do
zquery1.sql.text := 1st trigger;
zquery1.execsql;
zquery1.sql.text := 2st trigger;
zquery1.execsql;
zquery1.sql.text := 3st trigger;
zquery1.execsql;
.
.
.
zquery1.sql.text := N.... trigger;
zquery1.execsql;
What can i do to solve this.
What i want is to have a file.sql and do
component.sql.loadfromfile("file.sql");
component.Execsql;
and it does every thing on the file.
Any for this works fine
"
CREATE TRIGGER TRI_GRUPOS FOR GRUPOS ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF ((NEW.GR_ID IS NULL) OR (NEW.GR_ID = 0)) THEN BEGIN NEW.GR_ID =GEN_ID(GEN_GRUPOSID ,1);
"
On the 1st post is exacly what im using. Before this i have some code Create table but is ok.(I removed the CREATE TRIGGER SECTION and sql is executed.)
It just blocks on the 1st TRIGGER , on zsqlprocessor i added the "set term ^ ;"but didnt solve started and new error on "set term ^ ;" ...
So with "Set term ^" no error on "set term" but error continues on create trigger.
But i read a post i cant use trigger on zsqlprocessor and u gave a answer on in so i uses a zquery to the triggers
zsqlprcessor.execute;
zquery1.sql.text := is all trigger posted on 1st post ;
zquery1.execsql;
But doesnt work anyway,
do i have to do
zquery1.sql.text := 1st trigger;
zquery1.execsql;
zquery1.sql.text := 2st trigger;
zquery1.execsql;
zquery1.sql.text := 3st trigger;
zquery1.execsql;
.
.
.
zquery1.sql.text := N.... trigger;
zquery1.execsql;
What can i do to solve this.
What i want is to have a file.sql and do
component.sql.loadfromfile("file.sql");
component.Execsql;
and it does every thing on the file.
Any for this works fine
where's the code ..
grupostable exists , GR_ID is integer no null, of grupos table exits,
GEN_GRUPOSID is agenerator and exists to....
I did this on flamerobbin o run query :
create trigger TRI_GRUPOS FOR grupos active before insert
as
begin
if ((new.gr_id is null) or (new.gr_id = 0)) then
begin
new.gr_id = gen_id( GEN_GRUPOSID, 1);
end
end
The Result is this error :
Preparing query: create trigger TRI_GRUPOS FOR grupos active before insert
as
begin
if ((new.gr_id is null) or (new.gr_id = 0)) then
begin
new.GR_ID = gen_id( GEN_GRUPOSID, 1)
Error: *** IBPP::SQLException ***
Context: Statement::Prepare( create trigger TRI_GRUPOS FOR grupos active before insert
as
begin
if ((new.gr_id is null) or (new.gr_id = 0)) then
begin
new.GR_ID = gen_id( GEN_GRUPOSID, 1) )
Message: isc_dsql_prepare failed
SQL Message : -104
Invalid token
Engine Code : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -104
Unexpected end of command - line 6, column 38
Whats the problem ???
End of commabnd there a ";" is correct ??? not seeing the problem
Cant i execute this as a query ????
GEN_GRUPOSID is agenerator and exists to....
I did this on flamerobbin o run query :
create trigger TRI_GRUPOS FOR grupos active before insert
as
begin
if ((new.gr_id is null) or (new.gr_id = 0)) then
begin
new.gr_id = gen_id( GEN_GRUPOSID, 1);
end
end
The Result is this error :
Preparing query: create trigger TRI_GRUPOS FOR grupos active before insert
as
begin
if ((new.gr_id is null) or (new.gr_id = 0)) then
begin
new.GR_ID = gen_id( GEN_GRUPOSID, 1)
Error: *** IBPP::SQLException ***
Context: Statement::Prepare( create trigger TRI_GRUPOS FOR grupos active before insert
as
begin
if ((new.gr_id is null) or (new.gr_id = 0)) then
begin
new.GR_ID = gen_id( GEN_GRUPOSID, 1) )
Message: isc_dsql_prepare failed
SQL Message : -104
Invalid token
Engine Code : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -104
Unexpected end of command - line 6, column 38
Whats the problem ???
End of commabnd there a ";" is correct ??? not seeing the problem
Cant i execute this as a query ????
where's the code ..
FlameRobin Ok
This worlked on flame robin fine .....
But not on zsqlprocessor.
set term ^ ;
create trigger TRI_GRUPOS_ID1 for grupos
active before insert
as
begin
if ((new.gr_id is null) or (new.gr_id=0)) then
begin
new.gr_id = gen_id(GEN_GRUPOSID,1 );
end
end
^
set term ;^
But not on zsqlprocessor.
set term ^ ;
create trigger TRI_GRUPOS_ID1 for grupos
active before insert
as
begin
if ((new.gr_id is null) or (new.gr_id=0)) then
begin
new.gr_id = gen_id(GEN_GRUPOSID,1 );
end
end
^
set term ;^
where's the code ..
Finally i think i solved the problem with zsqlprocessor
Set zSqlProcessorDelimiterType := dtGo.
and In all statment did go:
ex :
go
Create soemething
go
create other thing
Dont use set term (big problems ).... but with go solves this issue ..
seawolf for ya support in all issues.
Set zSqlProcessorDelimiterType := dtGo.
and In all statment did go:
ex :
go
Create soemething
go
create other thing
Dont use set term (big problems ).... but with go solves this issue ..
seawolf for ya support in all issues.
where's the code ..
Re: exec
Yes you did it!!! It help me to create two tables with generators and triggers, thank you!sfxcc wrote:Indeed my last post of this issue is working perfectly till now.
I hope this help somebody .. it helped me a lot. of