[Qt-interest] from QT, how to Get sqlite Trigger's Raise Error
Bala Murugan
balamuruganramana at yahoo.com
Wed Oct 28 11:28:15 CET 2009
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
Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091028/9852ce0f/attachment.html
More information about the Qt-interest-old
mailing list