Create table - Error code: 21

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Create table - Error code: 21

papa
void myClass::CreateTable() {
     try {
         // Name's data
         wapstr = L"CREATE TABLE ";
         wapstr += table_name;
         wapstr += L"(";
         wapstr += L"id INT PRIMARY KEY NOT NULL, ";
         wapstr += L"title_name TEXT, ";
         wapstr += L"first_name TEXT, ";
         wapstr += L"middle_name TEXT, ";
         wapstr += L"last_name TEXT, ";
         // Address data
         wapstr += L"unit_number TEXT, ";
         wapstr += L"street_name TEXT, ";
         wapstr += L"city TEXT, ";
         wapstr += L"province TEXT, ";
         wapstr += L"postal_code TEXT, ";
         wapstr += L"country TEXT, ";
         // Phone1 data
         wapstr += L"country_code1 TEXT, ";
         wapstr += L"area_code1 TEXT, ";
         wapstr += L"region_code1 TEXT, ";
         wapstr += L"number1 TEXT, ";
         // Phone2 data
         wapstr += L"country_code2 TEXT, ";
         wapstr += L"area_code2 TEXT, ";
         wapstr += L"region_code2 TEXT, ";
         wapstr += L"number2 TEXT, ";
         // Phone3 data
         wapstr += L"country_code3 TEXT, ";
         wapstr += L"area_code3 TEXT, ";
         wapstr += L"region_code3 TEXT, ";
         wapstr += L"number3 TEXT, ";
         // Phone4 data
         wapstr += L"country_code4 TEXT, ";
         wapstr += L"area_code4 TEXT, ";
         wapstr += L"region_code4 TEXT, ";
         wapstr += L"number4 TEXT, ";
         // Email1 data
         wapstr += L"email1 TEXT, ";
         // Email2 data
         wapstr += L"email2 TEXT";
         wapstr += L");";
/*
Test shows:
CREATE TABLE Name(id INT PRIMARY KEY NOT NULL, title_name TEXT,
first_name TEXT, middle_name TEXT, last_name TEXT, unit_number TEXT,
street_name TEXT, city TEXT, province TEXT, postal_code TEXT, country
TEXT, country_code1 TEXT, area_code1 TEXT, region_code1 TEXT, number1
TEXT, country_code2 TEXT, area_code2 TEXT, region_code2 TEXT, number2
TEXT, country_code3 TEXT, area_code3 TEXT, region_code3 TEXT, number3
TEXT, country_code4 TEXT, area_code4 TEXT, region_code4 TEXT, number4
TEXT, email1 TEXT, email2 TEXT);
*/

         db->createTable(wapstr);

     } catch (std::shared_ptr<jme::WinException>& e) {
         throw e;
     }
}

void jme::SQLite3_RDB::createTable(const std::wstring& stm) {
     // 1) Assign function value to class value
     this->sql_statement_request = stm;
/*
Test shows that sql_statement_request is :
CREATE TABLE Name(id INT PRIMARY KEY NOT NULL, title_name TEXT,
first_name TEXT, middle_name TEXT, last_name TEXT, unit_number TEXT,
street_name TEXT, city TEXT, province TEXT, postal_code TEXT, country
TEXT, country_code1 TEXT, area_code1 TEXT, region_code1 TEXT, number1
TEXT, country_code2 TEXT, area_code2 TEXT, region_code2 TEXT, number2
TEXT, country_code3 TEXT, area_code3 TEXT, region_code3 TEXT, number3
TEXT, country_code4 TEXT, area_code4 TEXT, region_code4 TEXT, number4
TEXT, email1 TEXT, email2 TEXT);
*/
     // ******* THE ERROR IS HERE ****************
     this->rc = ::sqlite3_prepare_v2(db,
convert->toString(sql_statement_request).c_str(), -1,
&binary_sql_statement, NULL);
     if (this->rc != SQLITE_OK) {
         this->apstr = "Error message from SQLite3 ";
         this->apstr += ::sqlite3_errmsg(db);
         this->apstr += "\nError code: ";
         this->apstr += jme::core::to_string(this->rc);
         this->wapex->setException(this->apstr, JMEFILE, JMEMETHOD,
JMELINE);

         this->finalize();

         throw this->wapex;
     }
     try {
         this->runStep(this->binary_sql_statement);
     } catch (std::shared_ptr<jme::WinException>& we) {
         throw we;
     }

     // Call finalize to terminate the transaction - The constructor
closes the db connection.
     this->finalize();
}

The code shows what I have done to create a table, but
::sqlite3_prepare_v2 tells me:
---------------------------
Exception
---------------------------
Error message from SQLite3 - bad parameter or other API misuse
Error code: 21

The source code for SQLite3_RDB is here, should you'd like to see it.
http://arbolone.ca/Testings/sqlite3_rdb01.html
http://arbolone.ca/Testings/sqlite3_rdb02.html

Any help would be most appreciated.

--
ArbolOne.ca
Using Fire Fox and Thunderbird.
ArbolOne is composed of students and volunteers dedicated to providing free services to charitable organizations.
ArbolOne on Java Development in progress [ í ]

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Create table - Error code: 21

Clemens Ladisch
Papa wrote:
>     // ******* THE ERROR IS HERE ****************
>     this->rc = ::sqlite3_prepare_v2(db, convert->toString(sql_statement_request).c_str(), -1, &binary_sql_statement, NULL);
>     if (this->rc != SQLITE_OK) {
>         this->apstr = "Error message from SQLite3 ";
>         this->apstr += ::sqlite3_errmsg(db);
>
> Error message from SQLite3 - bad parameter or other API misuse

There must be something wrong with the connection object.  It's probably
not open.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Create table - Error code: 21

Simon Slavin-3
In reply to this post by papa


On 21 Sep 2017, at 9:07am, Papa <[hidden email]> wrote:

> convert->toString

Please check this function to make sure it does what you think it does.  What happens if you leave it out and process the raw C string instead ?

Also check what Clemens wrong.  What happens if you try to close the db connection at that point ?  Do you get an error or does it work ?

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Create table - Error code: 21

Hick Gunter
In reply to this post by papa
My guess is that you are not connecting to any database file, i.e. calling the constructor without a file name AND not calling the openCreateDatabase method before attemting to create a table.

BTW:

Your data model assumes a "Name" may have only 1 street address, but up to 4 telephone numbers and up to 2 email addresses.

This is most certainly inefficient (it duplicates shared information) and -if applied to real people - inadequate. Street addresses, phone numbers, and email addresses should go into their own tables and be linked via assignment tables.

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:[hidden email]] Im Auftrag von Papa
Gesendet: Donnerstag, 21. September 2017 10:08
An: SQLite Mailing List <[hidden email]>
Betreff: [EXTERNAL] [sqlite] Create table - Error code: 21

void myClass::CreateTable() {
     try {
         // Name's data
         wapstr = L"CREATE TABLE ";
         wapstr += table_name;
         wapstr += L"(";
         wapstr += L"id INT PRIMARY KEY NOT NULL, ";
         wapstr += L"title_name TEXT, ";
         wapstr += L"first_name TEXT, ";
         wapstr += L"middle_name TEXT, ";
         wapstr += L"last_name TEXT, ";
         // Address data
         wapstr += L"unit_number TEXT, ";
         wapstr += L"street_name TEXT, ";
         wapstr += L"city TEXT, ";
         wapstr += L"province TEXT, ";
         wapstr += L"postal_code TEXT, ";
         wapstr += L"country TEXT, ";
         // Phone1 data
         wapstr += L"country_code1 TEXT, ";
         wapstr += L"area_code1 TEXT, ";
         wapstr += L"region_code1 TEXT, ";
         wapstr += L"number1 TEXT, ";
         // Phone2 data
         wapstr += L"country_code2 TEXT, ";
         wapstr += L"area_code2 TEXT, ";
         wapstr += L"region_code2 TEXT, ";
         wapstr += L"number2 TEXT, ";
         // Phone3 data
         wapstr += L"country_code3 TEXT, ";
         wapstr += L"area_code3 TEXT, ";
         wapstr += L"region_code3 TEXT, ";
         wapstr += L"number3 TEXT, ";
         // Phone4 data
         wapstr += L"country_code4 TEXT, ";
         wapstr += L"area_code4 TEXT, ";
         wapstr += L"region_code4 TEXT, ";
         wapstr += L"number4 TEXT, ";
         // Email1 data
         wapstr += L"email1 TEXT, ";
         // Email2 data
         wapstr += L"email2 TEXT";
         wapstr += L");";
/*
Test shows:
CREATE TABLE Name(id INT PRIMARY KEY NOT NULL, title_name TEXT, first_name TEXT, middle_name TEXT, last_name TEXT, unit_number TEXT, street_name TEXT, city TEXT, province TEXT, postal_code TEXT, country TEXT, country_code1 TEXT, area_code1 TEXT, region_code1 TEXT, number1 TEXT, country_code2 TEXT, area_code2 TEXT, region_code2 TEXT, number2 TEXT, country_code3 TEXT, area_code3 TEXT, region_code3 TEXT, number3 TEXT, country_code4 TEXT, area_code4 TEXT, region_code4 TEXT, number4 TEXT, email1 TEXT, email2 TEXT); */

         db->createTable(wapstr);

     } catch (std::shared_ptr<jme::WinException>& e) {
         throw e;
     }
}

void jme::SQLite3_RDB::createTable(const std::wstring& stm) {
     // 1) Assign function value to class value
     this->sql_statement_request = stm;
/*
Test shows that sql_statement_request is :
CREATE TABLE Name(id INT PRIMARY KEY NOT NULL, title_name TEXT, first_name TEXT, middle_name TEXT, last_name TEXT, unit_number TEXT, street_name TEXT, city TEXT, province TEXT, postal_code TEXT, country TEXT, country_code1 TEXT, area_code1 TEXT, region_code1 TEXT, number1 TEXT, country_code2 TEXT, area_code2 TEXT, region_code2 TEXT, number2 TEXT, country_code3 TEXT, area_code3 TEXT, region_code3 TEXT, number3 TEXT, country_code4 TEXT, area_code4 TEXT, region_code4 TEXT, number4 TEXT, email1 TEXT, email2 TEXT); */
     // ******* THE ERROR IS HERE ****************
     this->rc = ::sqlite3_prepare_v2(db,
convert->toString(sql_statement_request).c_str(), -1,
&binary_sql_statement, NULL);
     if (this->rc != SQLITE_OK) {
         this->apstr = "Error message from SQLite3 ";
         this->apstr += ::sqlite3_errmsg(db);
         this->apstr += "\nError code: ";
         this->apstr += jme::core::to_string(this->rc);
         this->wapex->setException(this->apstr, JMEFILE, JMEMETHOD, JMELINE);

         this->finalize();

         throw this->wapex;
     }
     try {
         this->runStep(this->binary_sql_statement);
     } catch (std::shared_ptr<jme::WinException>& we) {
         throw we;
     }

     // Call finalize to terminate the transaction - The constructor closes the db connection.
     this->finalize();
}

The code shows what I have done to create a table, but
::sqlite3_prepare_v2 tells me:
---------------------------
Exception
---------------------------
Error message from SQLite3 - bad parameter or other API misuse Error code: 21

The source code for SQLite3_RDB is here, should you'd like to see it.
http://arbolone.ca/Testings/sqlite3_rdb01.html
http://arbolone.ca/Testings/sqlite3_rdb02.html

Any help would be most appreciated.

--
ArbolOne.ca
Using Fire Fox and Thunderbird.
ArbolOne is composed of students and volunteers dedicated to providing free services to charitable organizations.
ArbolOne on Java Development in progress [ í ]

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: [hidden email]

This communication (including any attachments) is intended for the use of the intended recipient(s) only and may contain information that is confidential, privileged or legally protected. Any unauthorized use or dissemination of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by return e-mail message and delete all copies of the original communication. Thank you for your cooperation.


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Create table - Error code: 21

Kees Nuyt
In reply to this post by papa
On Thu, 21 Sep 2017 04:07:36 -0400,
Papa <[hidden email]> wrote:

Just a side-note:

>         wapstr += L"id INT PRIMARY KEY NOT NULL, ";

"INT PRIMARY KEY" is not enough to create an alias for ROWID,
that only happenes with "INTEGER PRIMARY KEY" :

        ~ $ sqlite3 test.sqlite
        SQLite version 3.21.0 2017-08-14 01:33:07
        Enter ".help" for usage hints.
        sqlite> create table t1 (id INT PRIMARY KEY NOT NULL, tx
TEXT);
        sqlite> create table t2 (id INTEGER PRIMARY KEY NOT NULL, tx
TEXT);
        sqlite> pragma table_info(t1);
        0|id|INT|1||1
        1|tx|TEXT|0||0
        sqlite> pragma table_info(t2); -- looks the same, but:
        0|id|INTEGER|1||1
        1|tx|TEXT|0||0
        sqlite> insert into t1 (id,tx) values (3,'t1');
        sqlite> insert into t2 (id,tx) values (3,'t2');
        sqlite> select ROWID,id,tx from t1; -- ROWID not aliased
        1|3|t1
        sqlite> select ROWID,id,tx from t2; -- aliased as intended.
        3|3|t2
        sqlite>

I'm afraid I don't have an answer to your original question.

--
Regards,
Kees Nuyt
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Create table - Error code: 21

R Smith
In reply to this post by papa
On 2017/09/21 10:07 AM, Papa wrote:
>
> The code shows what I have done to create a table, but
> ::sqlite3_prepare_v2 tells me:
> ---------------------------
> Exception
> ---------------------------
> Error message from SQLite3 - bad parameter or other API misuse
> Error code: 21

Perhaps show us the entire code, including the actual call to
sqlite3_prepare_v2...
That is always better than to just say "I've called it and it says x..."

Perhaps we might notice a typo or other deficiency in the actual code
that you've missed, because the process, strings and method you describe
should in principle work perfectly, which means if it doesn't, there is
either a typo, an api misuse, or a real bug - none of which we can
reliably verify without seeing the entire code.

Also, does db->createTable() expect a full table declaration (including
the "CREATE TABLE" words and the semi-colon at the end)? Show the code
for that too.

When there is a Gremlin hiding somewhere, best is to expose all hiding
places.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Create table - Error code: 21

papa
Thanks for your help, in regards to your suggestion, here is the actual
method that makes the call to createTable.

void Person::CreateTable() {
     try {
         // Name's data
         wapstr = L"CREATE TABLE ";
         wapstr += table_name;
         wapstr += L"(";
         wapstr += L"id INT PRIMARY KEY NOT NULL, ";
         wapstr += L"title_name TEXT, ";
         wapstr += L"first_name TEXT, ";
         wapstr += L"middle_name TEXT, ";
         wapstr += L"last_name TEXT, ";
         // Address data
         wapstr += L"unit_number TEXT, ";
         wapstr += L"street_name TEXT, ";
         wapstr += L"city TEXT, ";
         wapstr += L"province TEXT, ";
         wapstr += L"postal_code TEXT, ";
         wapstr += L"country TEXT, ";
         // Phone1 data
         wapstr += L"country_code1 TEXT, ";
         wapstr += L"area_code1 TEXT, ";
         wapstr += L"region_code1 TEXT, ";
         wapstr += L"number1 TEXT, ";
         // Phone2 data
         wapstr += L"country_code2 TEXT, ";
         wapstr += L"area_code2 TEXT, ";
         wapstr += L"region_code2 TEXT, ";
         wapstr += L"number2 TEXT, ";
         // Phone3 data
         wapstr += L"country_code3 TEXT, ";
         wapstr += L"area_code3 TEXT, ";
         wapstr += L"region_code3 TEXT, ";
         wapstr += L"number3 TEXT, ";
         // Phone4 data
         wapstr += L"country_code4 TEXT, ";
         wapstr += L"area_code4 TEXT, ";
         wapstr += L"region_code4 TEXT, ";
         wapstr += L"number4 TEXT, ";
         // Email1 data
         wapstr += L"email1 TEXT, ";
         // Email2 data
         wapstr += L"email2 TEXT";
         wapstr += L");";

         db->createTable(wapstr);

     } catch (std::shared_ptr<jme::WinException>& e) {
         throw e;
     }
}

For the time being I'd like to leave the schema as it is, later on I
will divide it into different tables.
Again, thanks so much for your time.


On 2017-09-21 6:29 AM, R Smith wrote:

> On 2017/09/21 10:07 AM, Papa wrote:
>>
>> The code shows what I have done to create a table, but
>> ::sqlite3_prepare_v2 tells me:
>> ---------------------------
>> Exception
>> ---------------------------
>> Error message from SQLite3 - bad parameter or other API misuse
>> Error code: 21
>
> Perhaps show us the entire code, including the actual call to
> sqlite3_prepare_v2...
> That is always better than to just say "I've called it and it says x..."
>
> Perhaps we might notice a typo or other deficiency in the actual code
> that you've missed, because the process, strings and method you
> describe should in principle work perfectly, which means if it
> doesn't, there is either a typo, an api misuse, or a real bug - none
> of which we can reliably verify without seeing the entire code.
>
> Also, does db->createTable() expect a full table declaration
> (including the "CREATE TABLE" words and the semi-colon at the end)?
> Show the code for that too.
>
> When there is a Gremlin hiding somewhere, best is to expose all hiding
> places.
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

--
ArbolOne.ca
Using Fire Fox and Thunderbird.
ArbolOne is composed of students and volunteers dedicated to providing free services to charitable organizations.
ArbolOne on Java Development in progress [ í ]

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Create table - Error code: 21

Keith Medcalf
In reply to this post by Simon Slavin-3
>> convert->toString

>Please check this function to make sure it does what you think it
>does.  What happens if you leave it out and process the raw C string
>instead ?

You would have to change the string definition to a "normal" ASCII string.  

It is currently defined as UCS-2 characters and sqlite_prepare_v2 does not accept UCS-2 (2 byte characters), one single-byte ASCII (7-bit of a byte) or UTF-8.




_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Create table - Error code: 21

papa
In reply to this post by R Smith
Sorry, I realized that the example provided in my last email was not as
complete as it should have been. I hope the below example would do a
better job.

---------

namespace jme{
class Person{
          .....
         std::wstring wapstr; //!< All Purpose Wide String
         // Database
         std::wstring table_name; //<! Default table name
         std::wstring sql_statement; //<! sql statement
         std::unique_ptr<jme::SQLite3_RDB> db;

         // Database
         void CreateOpenDatabase(const std::wstring& );//!< Database name
         void CreateTable(); //!< Table name
}
};
void jme::Person::CreateOpenDatabase(const std::wstring& dbn) {
     this->db = std::make_unique<jme::SQLite3_RDB>(dbn);
}
void jme::Person::CreateTable() {
     try {
         // Name's data
         wapstr = L"CREATE TABLE ";
         wapstr += table_name;
         wapstr += L"(";
         wapstr += L"id INT PRIMARY KEY NOT NULL, ";
         wapstr += L"title_name TEXT, ";
         wapstr += L"first_name TEXT, ";
         wapstr += L"middle_name TEXT, ";
         wapstr += L"last_name TEXT, ";
         // Address data
         wapstr += L"unit_number TEXT, ";
         wapstr += L"street_name TEXT, ";
         wapstr += L"city TEXT, ";
         wapstr += L"province TEXT, ";
         wapstr += L"postal_code TEXT, ";
         wapstr += L"country TEXT, ";
         // Phone1 data
         wapstr += L"country_code1 TEXT, ";
         wapstr += L"area_code1 TEXT, ";
         wapstr += L"region_code1 TEXT, ";
         wapstr += L"number1 TEXT, ";
         // Phone2 data
         wapstr += L"country_code2 TEXT, ";
         wapstr += L"area_code2 TEXT, ";
         wapstr += L"region_code2 TEXT, ";
         wapstr += L"number2 TEXT, ";
         // Phone3 data
         wapstr += L"country_code3 TEXT, ";
         wapstr += L"area_code3 TEXT, ";
         wapstr += L"region_code3 TEXT, ";
         wapstr += L"number3 TEXT, ";
         // Phone4 data
         wapstr += L"country_code4 TEXT, ";
         wapstr += L"area_code4 TEXT, ";
         wapstr += L"region_code4 TEXT, ";
         wapstr += L"number4 TEXT, ";
         // Email1 data
         wapstr += L"email1 TEXT, ";
         // Email2 data
         wapstr += L"email2 TEXT";
         wapstr += L");";

         this->sql_statement = this->wapstr;

         db->createTable(this->sql_statement); // exception received here

         wapstr.clear();
     } catch (std::shared_ptr<jme::WinException>& e) {
         throw e;
     }
}
void jme::Person::WriteToDatabase(const std::wstring& db_name) {
     try {
         this->table_name = L"Name";
         CreateOpenDatabase(db_name);
         if (db->notExist(this->table_name)) {
             this->CreateTable();
         }
     } catch (std::shared_ptr<jme::WinException>& e) {
         throw e;
     }
}

-------

Thanks for the help.


On 2017-09-21 6:29 AM, R Smith wrote:

> On 2017/09/21 10:07 AM, Papa wrote:
>>
>> The code shows what I have done to create a table, but
>> ::sqlite3_prepare_v2 tells me:
>> ---------------------------
>> Exception
>> ---------------------------
>> Error message from SQLite3 - bad parameter or other API misuse
>> Error code: 21
>
> Perhaps show us the entire code, including the actual call to
> sqlite3_prepare_v2...
> That is always better than to just say "I've called it and it says x..."
>
> Perhaps we might notice a typo or other deficiency in the actual code
> that you've missed, because the process, strings and method you
> describe should in principle work perfectly, which means if it
> doesn't, there is either a typo, an api misuse, or a real bug - none
> of which we can reliably verify without seeing the entire code.
>
> Also, does db->createTable() expect a full table declaration
> (including the "CREATE TABLE" words and the semi-colon at the end)?
> Show the code for that too.
>
> When there is a Gremlin hiding somewhere, best is to expose all hiding
> places.
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

--
ArbolOne.ca
Using Fire Fox and Thunderbird.
ArbolOne is composed of students and volunteers dedicated to providing free services to charitable organizations.
ArbolOne on Java Development in progress [ í ]

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Create table - Error code: 21

papa
In reply to this post by Keith Medcalf
The SQLite3 wrapper class and the client class use std::wstring,
however, the wrapper performs the necessary conversion to
std::string::data(), before submitting the requests to SQLite3.
Nice of you to notice this provable cause.

Thanks so much for the help.


On 2017-09-21 5:37 PM, Keith Medcalf wrote:

>>> convert->toString
>> Please check this function to make sure it does what you think it
>> does.  What happens if you leave it out and process the raw C string
>> instead ?
> You would have to change the string definition to a "normal" ASCII string.
>
> It is currently defined as UCS-2 characters and sqlite_prepare_v2 does not accept UCS-2 (2 byte characters), one single-byte ASCII (7-bit of a byte) or UTF-8.
>
>
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

--
ArbolOne.ca
Using Fire Fox and Thunderbird.
ArbolOne is composed of students and volunteers dedicated to providing free services to charitable organizations.
ArbolOne on Java Development in progress [ í ]

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users