[Qt-interest] from QT, how to Get sqlite Trigger's Raise Error
Jan
janusius at gmx.net
Wed Oct 28 20:27:48 CET 2009
take a look at sqlite's mail list .-)
Bala Murugan schrieb:
> 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
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list