Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-20 Thread W O
Hello Sean I like to do double validation: at language program level and at database level. I don't like depending just of the language for any job, because always there are several programmers here, sometimes programming with different languages. If I can validate something in a stored procedure

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-20 Thread W O
Hello Sean I like to do double validation: at language program level and at database level. I don't like depending just of the language for any job, because always there are several programmers here, sometimes programming with different languages. If I can validate something in a stored procedure

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-20 Thread Ivan Přenosil
> doesn't insert a row in the table ERRORS when I write: > > EXECUTE PROCEDURE SAVE_LASTNAME(0, 'SMITH678901234567890123456') Isn’t it normal in all programming languages that when error occurs than normal program flow is interrupted ? You caused error *before* the procedure was invoked so it is

RE: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-20 Thread Leyne, Sean
Walter, > Because triggers could fix the data to be valid? > And that can be confusing, because to modern programmers accustomed to > nearly unlimited string types, varchar(x) is more about > CHECK(char_length(field) <= x) [logical-layer] than about APIs and C > compatibility [physical-layer]. U

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-20 Thread W O
That's was the idea Helen, to have records of the errors, all of them. But it seems it's impossible to record some errors because: CREATE PROCEDURE SAVE_LASTNAME( IDENTI TYPE OF COLUMN LASTNAMES.LSN_IDENTI, LASTNM TYPE OF COLUMN LASTNAMES.LSN_LASTNM) AS BEGIN UPDATE OR INSERT INTO LASTNAM

RE: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-20 Thread unordained
-- Original Message --- From: "Leyne, Sean" > It is as expected, data type constraints are enforced before all other > operations. > What would be the purpose of firing a trigger if the data is not valid? > Sean --- End of Original Message --- Because triggers could fix t

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-19 Thread Helen Borrie
> >On Thu, Sep 19, 2013 at 12:21 PM, Leyne, Sean ><s...@broadviewsoftware.com> wrote: > >It is as expected, data type constraints are enforced before all other >operations. > >What would be the purpose of firing a trigger if the data is not valid? At 05:51 a

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-19 Thread W O
firebird-support@yahoogroups.com > *Subject:* Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt > work here? > > ** ** > > > > > > > That's right, the trigger never fires when the column is VARCHAR(20) and > the lenght of data is greater tha

RE: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-19 Thread Leyne, Sean
, 2013 12:00 PM To: firebird-support@yahoogroups.com Subject: Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here? That's right, the trigger never fires when the column is VARCHAR(20) and the lenght of data is greater than 20. Is that a bug or it works as expected? Gree

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-19 Thread W O
That's right, the trigger never fires when the column is VARCHAR(20) and the lenght of data is greater than 20. Is that a bug or it works as expected? Greetings. Walter. On Thu, Sep 19, 2013 at 10:28 AM, Mark Rotteveel wrote: > ** > > > On 19-9-2013 15:58, Alan McDonald wrote: > > Use an ext

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-19 Thread Mark Rotteveel
On 19-9-2013 15:58, Alan McDonald wrote: > Use an external table to log errors. They are not subject to > transactions. But if the trigger doesn't fire, that won't help. Mark -- Mark Rotteveel

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-19 Thread Alan McDonald
> > > > Yes Mark, no doubt about that, but: Why? > > It is in a trigger "before insert or update" > > Is the insert or update action rejected before the trigger is executed? > Then it is impossible to use IN AUTONOMOUS TRANSACTION in a trigger and > save the error in a table. > > And that would be

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-19 Thread W O
Yes Mark, no doubt about that, but: Why? It is in a trigger "before insert or update" Is the insert or update action rejected before the trigger is executed? Then it is impossible to use IN AUTONOMOUS TRANSACTION in a trigger and save the error in a table. And that would be very useful. Greetin

Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-19 Thread Mark Rotteveel
On 18-9-2013 22:12, W O wrote: > In the trigger EMPLEADOS_BIU is the sentence "INSERT INTO ERRORES..." > but a row is inserted into the table ERRORES only if there are no errors. > > This works fine: > > INSERT INTO EMPLEADOS (EMP_NOMBRE, EMP_APELLD) VALUES ('JUAN', 'PEREZ'); > > but it doesnt work

[firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?

2013-09-18 Thread W O
Hello everybody I have a table: CREATE TABLE ERRORES ( ERR_MODULO VARCHAR(64), ERR_COMENT VARCHAR(255)); and another table: CREATE TABLE EMPLEADOS ( EMP_IDENTI BIGINT, EMP_NOMBRE VARCHAR(20), EMP_APELLD VARCHAR(20)); SET TERM ^ ; CREATE TRIGGER EMPLEADOS_BIU FOR EMPLEADOS ACTIVE BE