繁体   English   中英

在C ++中执行SQL脚本

[英]Executing sql script in c++

我是SQL新手。 是否可以使用C ++中的某些库来执行sql命令,例如

    std::shared_ptr<database> ptr( new odb::sqlite::database ("database.db",      
    SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE));
    //the above line contains the  pointer and the lower line contains the function that executes the query on the databse with the pointer
    executesql("select * from tablea where x> y ", ptr);

因为发生的事情是我从另一台计算机上以“ select from etc ...”格式获取sql查询,所以我想以类似的方式执行它而不用解析任何东西并编写新代码来这样做。

我终于找到了答案。 在以下链接中提供了很多详细信息。 http://www.codeproject.com/Tips/378808/Accessing-a-SQLite-Database-with-Cplusplus

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM