English 中文(简体)
查看指挥窗口中的Sqlite3_stmt*
原标题:Viewing sqlite3_stmt* in command window

我继承了一个没有经过充分评论的LQ数据库,我需要了解它正在问答和接受什么。 是否有办法看到<代码>sqlite3_stmt的点名? 能否在<条码>f(或<条码>上向议会印刷?

Thanks

问题回答

最好的办法是追踪汇编的说明。 我在该问题的帮助下找到了解决办法:

qlite3_trace的指挥触发了一种警示,需要加以编码。 一旦追踪被转手,将执行方案的其他部分。

我把我的所有数据库都输入单一类别,我把这一功能作为反馈功能(C功能,而不是一种方法)。

void traceCallback( void* udp, const char* sql ) 
{ 
    printf("{SQL} [%s]
", sql); 
} 

我将追踪数据输入了一个内基数据库方法:一旦数据库开放,该数据库就转而使用。

-(void)initializeDatabase 
{
    NSString *path = [self createEditableCopyOfDatabaseIfNeeded];
    // open the db
    if (sqlite3_open([path UTF8String], &db) == SQLITE_OK)
        sqlite3_trace(db, traceCallback, NULL);
    else {
        // error - cleanup
        sqlite3_close(db);
        NSLog(@"Error opening db");
        NSLog(@"Path: %@",path);
    }
}

This will turn a SQL statement with bound variables into a string. From this:

const char *sql2 = "select a.key, b.key from words a left outer join known_words b on a.key = b.word_id where a.word_foreign = :word_foreign";

为此:

{SQL} [select a.key, b.key from words a left outer join known_words b on a.key = b.word_id    where a.word_foreign =  bak. ]




相关问题
sqlite3 is chopping/cutting/truncating my text columns

I have values being cut off and would like to display the full values. Sqlite3 -column -header locations.dbs " select n.namelist, f.state, t.state from names n left join locations l on l.id = n.id ...

Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I m not crazy about having ...

Improve INSERT-per-second performance of SQLite

Optimizing SQLite is tricky. Bulk-insert performance of a C application can vary from 85 inserts per second to over 96,000 inserts per second! Background: We are using SQLite as part of a desktop ...

Metadata for columns in SQLite v2.8 (PHP5)

How can I get metadata / constraints (primary key and "null allowed" in particular) for each column in a SQLite v2.8 table using PHP5 (like mysql_fetch_field for MySql)? sqlite_fetch_column_types (OO:...

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签