-1

I try to run the C++ code, which is more-less taken from the DuckDB documentation, but I can't make it work. Compilation is fine, but the output from Print() function is an error message:

Parser Error: syntax error at or near "..."

The "..." represent some random characters, each time I run it, it is something different. I am using

  • Windows 11
  • Visual Studio 2022
  • C++20
  • compiler flag /utf-8.

The C++ code I run is:

int main()
{
   duckdb::DuckDB db(nullptr);
   duckdb::Connection con(db);

   std::string qs0{ "CREATE TABLE mytbl(a SQLTypeId::INTEGER, b SQLTypeId::INTEGER)" };
   con.Query(qs0);

   std::string qs1{ "INSERT INTO mytbl(a, b) VALUES (3, 4)" };
   con.Query(qs1);

   con.Query("SELECT * FROM mytbl")->Print();
}
πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
query
  • 329
  • 7
  • 18

0 Answers0