>From the manual, doesnt sqlite3_prepare do the following: "To execute
an SQL query, it must first be compiled into a byte-code program using
one of these routines." If you are really paranoid, what about taking
the input SQL statement x and then verifying it by issuing:
sqlite3_prepare("EXPLAIN x")? That way I just tried "EXPLAIN SELECT
id1 FROM myTable" where table 'myTable' contains no column 'id1' and
it informed me of my error.
On Thu, Jul 3, 2008 at 10:23 AM, Umaa Krishnan <[EMAIL PROTECTED]> wrote:
> Well, I assume SQLPrepare allocates and locks appropriate resources. I need
> to only check the sanity of the statement, and then discard.
>
> So I was wondering if there was a way to do it, instead of prepare statement
>
> --- On Thu, 7/3/08, D. Richard Hipp <[EMAIL PROTECTED]> wrote:
> From: D. Richard Hipp <[EMAIL PROTECTED]>
> Subject: Re: [sqlite] validate SQL Statement
> To: "General Discussion of SQLite Database" <[email protected]>
> Date: Thursday, July 3, 2008, 2:10 AM
>
> On Jul 2, 2008, at 11:03 PM, Umaa Krishnan wrote:
>
>> I was wondering if there a way in sqlite, wherein I could validate
>> the SQL statement (for correct grammar, resource name - column name,
>> table name etc), w/o having to do prepare.
>
>
> You speak as if sqlite3_prepare() were a huge burden - something worth
> avoiding. In practice it is usually very fast. What problem are you
> trying to solve?
>
> No, there is no other way to validate an SQL statement.
>
>
> D. Richard Hipp
> [EMAIL PROTECTED]
>
>
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users