miraks
9th March 2011, 12:50
Hi,
In my project, I am using a qslite database opened with QSqlDatabase with "QSQLITE" driver.
I would like to be able to execute a SELECT statement with a REGEXP like:
SELECT * FROM mytable WHERE myattribute REGEXP 'A[0-9]*';
But, as written in sqlite documentation (http://www.sqlite.org/lang_expr.html), the REGEXP function is not implemented by default:
No regexp() user function is defined by default and so use of the REGEXP operator will normally result in an error message
I know we can implement this function by using sqlite3_create_function but I don't know how to do and if it's the better solution and I would like to avoid prerequisites on sqlite library.
My questions:
Q1-How to add REGEXP implementation on SQLITE driver ?
Q2-Do you know if QT plan to deliver a default implementation of sqlite REGEXP function based on QRegExp ?
Thank you in advance for your help.
In my project, I am using a qslite database opened with QSqlDatabase with "QSQLITE" driver.
I would like to be able to execute a SELECT statement with a REGEXP like:
SELECT * FROM mytable WHERE myattribute REGEXP 'A[0-9]*';
But, as written in sqlite documentation (http://www.sqlite.org/lang_expr.html), the REGEXP function is not implemented by default:
No regexp() user function is defined by default and so use of the REGEXP operator will normally result in an error message
I know we can implement this function by using sqlite3_create_function but I don't know how to do and if it's the better solution and I would like to avoid prerequisites on sqlite library.
My questions:
Q1-How to add REGEXP implementation on SQLITE driver ?
Q2-Do you know if QT plan to deliver a default implementation of sqlite REGEXP function based on QRegExp ?
Thank you in advance for your help.