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

2017-09-21 Thread Papa
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
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


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

2017-09-21 Thread Papa
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; // 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(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& 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& 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
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


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

2017-09-21 Thread Keith Medcalf
>> 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
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


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

2017-09-21 Thread 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& 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


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

2017-09-21 Thread R Smith

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


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

2017-09-21 Thread Kees Nuyt
On Thu, 21 Sep 2017 04:07:36 -0400, 
Papa  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
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


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

2017-09-21 Thread Simon Slavin


On 21 Sep 2017, at 9:07am, Papa  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
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


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

2017-09-21 Thread Clemens Ladisch
Papa wrote:
> // *** THE ERROR IS HERE 
> this->rc = ::sqlite3_prepare_v2(db, 
> convert->toString(sql_statement_request).c_str(), -1, _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
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Create table - Error code: 21

2017-09-21 Thread 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& 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, 
_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& 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
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Create table error on AIX -- Unable to open database "mytest": SQL logic error or missing database

2008-04-07 Thread Dennis Cote
Chris Pierce wrote:
> 
> Here's what I'm doing/getting:
> 
> AIX$ ./sqlite3 test.db
> SQLite version 3.5.7
> Enter ".help" for instructions
> sqlite> create table mytest(first smallint);
> Unable to open database "mytest": SQL logic error or
> missing database
> AIX$
> 

There is something fishy going on here. The filename you provide on the 
command line is "test.db", but the file SQLite says it can't create is 
"mytest".

Is this really a copy of what you entered and th emessages SQLite 
produced, or is it a hand edited version?

I suspect you may have a permission problem in the directory where you 
are trying to create the database file. You must have write permission 
in that directory.

Dennis Cote
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Create table error on AIX -- Unable to open database "mytest": SQL logic error or missing database

2008-04-06 Thread Chris Pierce
John Stanton wrote:
>
> I had a problem compiling Sqlite on ealrier 
> versions of AIX.  It turned out to be a linker
> problem and compiling without the -g optimization
> solved the problem.

The configure process shows an entry that says:

  checking whether accepts -g... no

I edited the Makefile and removed the -g from CFLAGS &
CXXFLAGS, but I still get the same error when trying
to create a table.

I've also tried this:

  AIX$ CFLAGS="-Os" ./configure

and with CFLAGS="-O" (grasping since I don't have a
clue), but always still get the error.


> What compiler are you using?  Xlc or gcc?

Xlc.  C for AIX Compiler, Version 5.

Chris


>Chris Pierce wrote:
>> Hi,
>> 
>> I am having problems with SQLite v3.5.7 on AIX
v5.2.
>> 
>> I downloaded the amalgamation tarball.  It looks
like
>> it builds fine, but I get an error when I try to
>> create a table.
>> 
>> Here's what I'm doing/getting:
>> 
>> AIX$ ./sqlite3 test.db
>> SQLite version 3.5.7
>> Enter ".help" for instructions
>> sqlite> create table mytest(first smallint);
>> Unable to open database "mytest": SQL logic error
or
>> missing database
>> AIX$
[...]


  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Create table error on AIX -- Unable to open database "mytest": SQL logic error or missing database

2008-04-06 Thread John Stanton
I had a problem compiling Sqlite on ealrier versions of AIX.  It turned 
out to be a linker problem and compiling without the -g optimization 
solved the problem.

What compiler are you using?  Xlc or gcc?

Chris Pierce wrote:
> Hi,
> 
> I am having problems with SQLite v3.5.7 on AIX v5.2.
> 
> I downloaded the amalgamation tarball.  It looks like
> it builds fine, but I get an error when I try to
> create a table.
> 
> Here's what I'm doing/getting:
> 
> AIX$ ./sqlite3 test.db
> SQLite version 3.5.7
> Enter ".help" for instructions
> sqlite> create table mytest(first smallint);
> Unable to open database "mytest": SQL logic error or
> missing database
> AIX$
> 
> I've searched the list's archives and seen some
> similar problems, but I have been unable to fix the
> problem.
> 
> Looking through the config.log file I guess it's not
> building fine.  Here are a few things from the log
> that may or may not help in troubleshooting:
> 
> 1) configure:3025: cc -c -Os  conftest.c >&5
> "conftest.c", line 15.14: 1506-275 (S) Unexpected text
> me encountered.
> "conftest.c", line 15.8: 1506-045 (S) Undeclared
> identifier choke.
> configure:3031: $? = 1
> configure: failed program was:
> | /* confdefs.h.  */
> | #define PACKAGE_NAME "sqlite"
> | #define PACKAGE_TARNAME "sqlite"
> | #define PACKAGE_VERSION "3.5.7"
> | #define PACKAGE_STRING "sqlite 3.5.7"
> | #define PACKAGE_BUGREPORT "http://www.sqlite.org;
> | #define PACKAGE "sqlite"
> | #define VERSION "3.5.7"
> | /* end confdefs.h.  */
> |
> | int
> | main ()
> | {
> | #ifndef __GNUC__
> |choke me
> | #endif
> |
> |   ;
> |   return 0;
> | }
> 
> 2) configure:3279: cc  -c -Os  conftest.c >&5
> "conftest.c", line 45.39: 1506-195 (S) Integral
> constant expression with a value
>  greater than zero is required.
> configure:3285: $? = 1
> configure: failed program was:
> | /* confdefs.h.  */
> 
> 3) configure:3279: cc -qlanglvl=extc89 -c -Os 
> conftest.c >&5
> 1506-173 (W) Option langlvl=extc89 is not valid. 
> Enter xlc for list of valid op
> tions.
> "conftest.c", line 45.39: 1506-195 (S) Integral
> constant expression with a value
>  greater than zero is required.
> 
> 
> I'm not sure if any of this is helpful or not.  There
> are more errors like this.  I can send the whole
> config.log if needed.  Oh, the system has cc, but
> doesn't have gcc, FWIW.
> 
> BTW, I used the Windows version to create a small test
> database that works fine in Windows, but when I try to
> use it with the AIX build I still get the error:
> 
> AIX$ ./sqlite3 test.db
> Unable to open database "test.db": SQL logic error or
> missing database
> AIX$
> 
> Sorry for the long message, but if anyone could help I
> would greatly appreciate it.
> 
> I'm not much of a C programmer, I'm rusty on *nix, and
> I'm not an admin on this system.
> 
> Please let me know if there is other information I
> need to send that might help in fixing the problem (or
> if I'm just completely missing the obvious cause).
> 
> Thanks!
> 
> Chris
> [EMAIL PROTECTED]
> 
> 
> 
>   
> 
> You rock. That's why Blockbuster's offering you one month of Blockbuster 
> Total Access, No Cost.  
> http://tc.deals.yahoo.com/tc/blockbuster/text5.com
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Create table error on AIX -- Unable to open database "mytest": SQL logic error or missing database

2008-04-05 Thread Chris Pierce
Hi,

I am having problems with SQLite v3.5.7 on AIX v5.2.

I downloaded the amalgamation tarball.  It looks like
it builds fine, but I get an error when I try to
create a table.

Here's what I'm doing/getting:

AIX$ ./sqlite3 test.db
SQLite version 3.5.7
Enter ".help" for instructions
sqlite> create table mytest(first smallint);
Unable to open database "mytest": SQL logic error or
missing database
AIX$

I've searched the list's archives and seen some
similar problems, but I have been unable to fix the
problem.

Looking through the config.log file I guess it's not
building fine.  Here are a few things from the log
that may or may not help in troubleshooting:

1) configure:3025: cc -c -Os  conftest.c >&5
"conftest.c", line 15.14: 1506-275 (S) Unexpected text
me encountered.
"conftest.c", line 15.8: 1506-045 (S) Undeclared
identifier choke.
configure:3031: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "sqlite"
| #define PACKAGE_TARNAME "sqlite"
| #define PACKAGE_VERSION "3.5.7"
| #define PACKAGE_STRING "sqlite 3.5.7"
| #define PACKAGE_BUGREPORT "http://www.sqlite.org;
| #define PACKAGE "sqlite"
| #define VERSION "3.5.7"
| /* end confdefs.h.  */
|
| int
| main ()
| {
| #ifndef __GNUC__
|choke me
| #endif
|
|   ;
|   return 0;
| }

2) configure:3279: cc  -c -Os  conftest.c >&5
"conftest.c", line 45.39: 1506-195 (S) Integral
constant expression with a value
 greater than zero is required.
configure:3285: $? = 1
configure: failed program was:
| /* confdefs.h.  */

3) configure:3279: cc -qlanglvl=extc89 -c -Os 
conftest.c >&5
1506-173 (W) Option langlvl=extc89 is not valid. 
Enter xlc for list of valid op
tions.
"conftest.c", line 45.39: 1506-195 (S) Integral
constant expression with a value
 greater than zero is required.


I'm not sure if any of this is helpful or not.  There
are more errors like this.  I can send the whole
config.log if needed.  Oh, the system has cc, but
doesn't have gcc, FWIW.

BTW, I used the Windows version to create a small test
database that works fine in Windows, but when I try to
use it with the AIX build I still get the error:

AIX$ ./sqlite3 test.db
Unable to open database "test.db": SQL logic error or
missing database
AIX$

Sorry for the long message, but if anyone could help I
would greatly appreciate it.

I'm not much of a C programmer, I'm rusty on *nix, and
I'm not an admin on this system.

Please let me know if there is other information I
need to send that might help in fixing the problem (or
if I'm just completely missing the obvious cause).

Thanks!

Chris
[EMAIL PROTECTED]



  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] create table error

2007-05-14 Thread allen . zhang
close it.
that is for my reason.
the relloc memory error!




"Mohd Radzi Ibrahim" <[EMAIL PROTECTED]> 
2007-05-10 16:44
Please respond to
sqlite-users@sqlite.org


To
<sqlite-users@sqlite.org>
cc

Subject
Re: [sqlite] create table error






Could it be that the data where *sql is pointing to is being re-used 
somewhere?


--radzi.

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Thursday, May 10, 2007 3:54 PM
Subject: [sqlite] create table error


> the following is my test code. just create table.
>
>
> rc = sqlite3_open("zieckey.db", );
> char *sql = " CREATE TABLE SensorData(ID INTEGER PRIMARY KEY,SensorID
> INTEGER,SiteNum INTEGER,Time VARCHAR(12),SensorParameter REAL);" ;
> sqlite3_exec( db , sql , 0 , 0 ,  );
> sqlite3_close(db);
>
>
>
> when execute the sqlite3_exec function,
>
> it corrupt at line 189, sqlite3StrICmp(pTab->aCol[j].zName,
> pChanges->a[i].zName)==0 )
>
> pChanges->a[i].zName is NULL;
>
> anybody know the reason ?
>
>
> how to trace the error? there is no clue for me to analyze the error.
>
> thanks a lot
>
> allen.zhang
> 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-




Re: [sqlite] create table error

2007-05-10 Thread Mohd Radzi Ibrahim
Could it be that the data where *sql is pointing to is being re-used 
somewhere?



--radzi.

- Original Message - 
From: <[EMAIL PROTECTED]>

To: <sqlite-users@sqlite.org>
Sent: Thursday, May 10, 2007 3:54 PM
Subject: [sqlite] create table error



the following is my test code. just create table.


rc = sqlite3_open("zieckey.db", );
char *sql = " CREATE TABLE SensorData(ID INTEGER PRIMARY KEY,SensorID
INTEGER,SiteNum INTEGER,Time VARCHAR(12),SensorParameter REAL);" ;
sqlite3_exec( db , sql , 0 , 0 ,  );
sqlite3_close(db);



when execute the sqlite3_exec function,

it corrupt at line 189, sqlite3StrICmp(pTab->aCol[j].zName,
pChanges->a[i].zName)==0 )

pChanges->a[i].zName is NULL;

anybody know the reason ?


how to trace the error? there is no clue for me to analyze the error.

thanks a lot

allen.zhang





-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] create table error

2007-05-10 Thread allen . zhang
the following is my test code. just create table.


 rc = sqlite3_open("zieckey.db", ); 
 char *sql = " CREATE TABLE SensorData(ID INTEGER PRIMARY KEY,SensorID 
INTEGER,SiteNum INTEGER,Time VARCHAR(12),SensorParameter REAL);" ;
 sqlite3_exec( db , sql , 0 , 0 ,  );
 sqlite3_close(db); 



when execute the sqlite3_exec function,

it corrupt at line 189, sqlite3StrICmp(pTab->aCol[j].zName, 
pChanges->a[i].zName)==0 )

pChanges->a[i].zName is NULL;

anybody know the reason ?


how to trace the error? there is no clue for me to analyze the error.

thanks a lot

allen.zhang