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
sqlite-users@mailinglists.sqlite.org
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
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to