BalaQT
28th October 2009, 09:26
hi,
im using QT4.5 and sqlite3
im using BEFORE INSERT TRIGGER for validation purpose
[is it good idea to put validation on before_insert_trigger???]
im generating err , when the validation fails
like
create TRIGGER MobileValid BEFORE INSERT on PARAM_DETAILS
when new.PARAM_CODE=12
BEGIN
SELECT RAISE(ABORT,'First Digit Should Be 9') where substr(new.PARAM_VALUE,1,1)<>'9' ;
SELECT RAISE(ABORT,'Length Should Be 10') where length(new.PARAM_VALUE)<>10 ;
END;
This is working fine.
My question is , how to get this TRIGGER RAISE ERROR in QT application?
IN QT im inserting as
q.exec("insert into PARAM_DETAILS(PARAM_CODE,PARAM_VALUE) values(12,'9789')");
when i execute this insert code in sqlite3 cmd prompt , i got the error raise by trigger;
but how to capture this err in QT APPLICAITON?
pls guide me?
bala
im using QT4.5 and sqlite3
im using BEFORE INSERT TRIGGER for validation purpose
[is it good idea to put validation on before_insert_trigger???]
im generating err , when the validation fails
like
create TRIGGER MobileValid BEFORE INSERT on PARAM_DETAILS
when new.PARAM_CODE=12
BEGIN
SELECT RAISE(ABORT,'First Digit Should Be 9') where substr(new.PARAM_VALUE,1,1)<>'9' ;
SELECT RAISE(ABORT,'Length Should Be 10') where length(new.PARAM_VALUE)<>10 ;
END;
This is working fine.
My question is , how to get this TRIGGER RAISE ERROR in QT application?
IN QT im inserting as
q.exec("insert into PARAM_DETAILS(PARAM_CODE,PARAM_VALUE) values(12,'9789')");
when i execute this insert code in sqlite3 cmd prompt , i got the error raise by trigger;
but how to capture this err in QT APPLICAITON?
pls guide me?
bala