I'd like to propose the following simple piece of code be added to sqlite. I believe it has some benefits for those who've wrapped the sqlite api's keeping copies in memory of the sql statement being executed. Add an api call that will return the saved SQL if using sqlite3_prepare_v2 or NULL if using sqlite3_prepare: char * sqlite3_stmt_sql(sqlite3_stmt* pStmt ) { return( sqlite3VdbeGetSql( (Vdbe *) pStmt) ); } I Kenneth Long, Contribute the above to the public domain.