Re: [sqlite] Programming API vs console

2013-04-28 Thread Simon Slavin

On 28 Apr 2013, at 9:55am, Igor Korot  wrote:

> Apologies for noise.
> That was an error on my side, which was discovered after spending couple of
> hours debugging.

No problem.  Glad you figured it out.

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


Re: [sqlite] Programming API vs console

2013-04-28 Thread Igor Korot
Apologies for noise.
That was an error on my side, which was discovered after spending couple of
hours debugging.

Thank you all for the help and sorry once again.


On Sat, Apr 27, 2013 at 5:20 AM, Simon Slavin  wrote:

>
> On 27 Apr 2013, at 8:34am, Igor Korot  wrote:
>
> > In the other area of the program I have a transaction that does 5 or 6
> > inserts and no selects.
> > This transaction works fine as I just verified.
> >
> > Now in the failing case the flow goes like this:
> >
> > First the program updates couple of tables, then it inserts this
> particular
> > record.
> > This algorithm is going thru the loop of the players vector.
> > I'm using the same handle and the same statement object. Only different
> > queries.
> >
> > After every query I'm calling sqlite3_finalize() to free the memory and
> the
> > statement object.
> >
> > Am I doing it wrong?
>
> See section 3.0 in
>
> 
>
> If you're not sure whether you're doing it right or not, stop doing it.
>  Do a _prepare() _step() _finalize() on each command and see if that fixes
> your problem.  Once you know what fixes it you'll know what to do in your
> final code.
>
> You are not doing sufficient exploration yourself to tell us what's wrong.
>  You are combining both a complicated INSERT and a complicated SELECT and
> we have no way to tell which one isn't doing what you expected.
>
> Create a new table with just one integer column.  Write code in your
> language to
>
> Count the rows in your table.
> Insert a new row in that.
> Count the rows again.
>
> Do it first with _exec instead of _prepare() _step() _finalize().  If your
> code doesn't work you now have something incredibly simple to debug.  If it
> does work, gradually add the complications of your original example back in
> until it stops working.  At that point you will have identified what it is
> you're doing that isn't working properly.
>
> Simon.
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-27 Thread Simon Slavin

On 27 Apr 2013, at 8:34am, Igor Korot  wrote:

> In the other area of the program I have a transaction that does 5 or 6
> inserts and no selects.
> This transaction works fine as I just verified.
> 
> Now in the failing case the flow goes like this:
> 
> First the program updates couple of tables, then it inserts this particular
> record.
> This algorithm is going thru the loop of the players vector.
> I'm using the same handle and the same statement object. Only different
> queries.
> 
> After every query I'm calling sqlite3_finalize() to free the memory and the
> statement object.
> 
> Am I doing it wrong?

See section 3.0 in



If you're not sure whether you're doing it right or not, stop doing it.  Do a 
_prepare() _step() _finalize() on each command and see if that fixes your 
problem.  Once you know what fixes it you'll know what to do in your final code.

You are not doing sufficient exploration yourself to tell us what's wrong.  You 
are combining both a complicated INSERT and a complicated SELECT and we have no 
way to tell which one isn't doing what you expected.

Create a new table with just one integer column.  Write code in your language to

Count the rows in your table.
Insert a new row in that.
Count the rows again.

Do it first with _exec instead of _prepare() _step() _finalize().  If your code 
doesn't work you now have something incredibly simple to debug.  If it does 
work, gradually add the complications of your original example back in until it 
stops working.  At that point you will have identified what it is you're doing 
that isn't working properly.

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


Re: [sqlite] Programming API vs console

2013-04-27 Thread Igor Korot
Amit,

On Sat, Apr 27, 2013 at 1:00 AM, Amit Chaudhuri
wrote:

> CREATE TABLE playersdrafted(playerid integer, id ineteger,
>
> Don't think ineteger is what you really mean.:)
> Seen it twice now so guessing it's actually in the code
>

Why you say so?
It is a foreign key representation, so integer is perfectly normal column
type.

Thank you.


>
>
> On Sat, Apr 27, 2013 at 8:34 AM, Igor Korot  wrote:
>
> > Simon,
> > In the other area of the program I have a transaction that does 5 or 6
> > inserts and no selects.
> > This transaction works fine as I just verified.
> >
> > Now in the failing case the flow goes like this:
> >
> > First the program updates couple of tables, then it inserts this
> particular
> > record.
> > This algorithm is going thru the loop of the players vector.
> > I'm using the same handle and the same statement object. Only different
> > queries.
> >
> > After every query I'm calling sqlite3_finalize() to free the memory and
> the
> > statement object.
> >
> > Am I doing it wrong?
> >
> > Thank you.
> >
> >
> > On Sat, Apr 27, 2013 at 12:10 AM, Simon Slavin 
> > wrote:
> >
> > >
> > > On 27 Apr 2013, at 8:05am, Igor Korot  wrote:
> > >
> > > > No. Using straight insert with values does not work.
> > > > Record still not inserted.
> > >
> > > Okay, so you now don't have to worry about parameters, or a sub-select
> or
> > > any of those things.  What you have identified is that a simple INSERT
> > with
> > > all values supplied returns SQLITE_OK but doesn't insert a record.
> > >
> > > Make up a simpler TABLE and try inserting into that one.  A table with
> > one
> > > INTEGER column ?  In fact, see if you can get any INSERT command
> working
> > at
> > > all, then work your way up to one that doesn't work and see if you can
> > find
> > > the thing that makes the INSERT stops working.
> > >
> > > Simon.
> > > ___
> > > 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-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


Re: [sqlite] Programming API vs console

2013-04-27 Thread Amit Chaudhuri
CREATE TABLE playersdrafted(playerid integer, id ineteger,

Don't think ineteger is what you really mean.:)
Seen it twice now so guessing it's actually in the code


On Sat, Apr 27, 2013 at 8:34 AM, Igor Korot  wrote:

> Simon,
> In the other area of the program I have a transaction that does 5 or 6
> inserts and no selects.
> This transaction works fine as I just verified.
>
> Now in the failing case the flow goes like this:
>
> First the program updates couple of tables, then it inserts this particular
> record.
> This algorithm is going thru the loop of the players vector.
> I'm using the same handle and the same statement object. Only different
> queries.
>
> After every query I'm calling sqlite3_finalize() to free the memory and the
> statement object.
>
> Am I doing it wrong?
>
> Thank you.
>
>
> On Sat, Apr 27, 2013 at 12:10 AM, Simon Slavin 
> wrote:
>
> >
> > On 27 Apr 2013, at 8:05am, Igor Korot  wrote:
> >
> > > No. Using straight insert with values does not work.
> > > Record still not inserted.
> >
> > Okay, so you now don't have to worry about parameters, or a sub-select or
> > any of those things.  What you have identified is that a simple INSERT
> with
> > all values supplied returns SQLITE_OK but doesn't insert a record.
> >
> > Make up a simpler TABLE and try inserting into that one.  A table with
> one
> > INTEGER column ?  In fact, see if you can get any INSERT command working
> at
> > all, then work your way up to one that doesn't work and see if you can
> find
> > the thing that makes the INSERT stops working.
> >
> > Simon.
> > ___
> > 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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Programming API vs console

2013-04-27 Thread Igor Korot
Simon,
In the other area of the program I have a transaction that does 5 or 6
inserts and no selects.
This transaction works fine as I just verified.

Now in the failing case the flow goes like this:

First the program updates couple of tables, then it inserts this particular
record.
This algorithm is going thru the loop of the players vector.
I'm using the same handle and the same statement object. Only different
queries.

After every query I'm calling sqlite3_finalize() to free the memory and the
statement object.

Am I doing it wrong?

Thank you.


On Sat, Apr 27, 2013 at 12:10 AM, Simon Slavin  wrote:

>
> On 27 Apr 2013, at 8:05am, Igor Korot  wrote:
>
> > No. Using straight insert with values does not work.
> > Record still not inserted.
>
> Okay, so you now don't have to worry about parameters, or a sub-select or
> any of those things.  What you have identified is that a simple INSERT with
> all values supplied returns SQLITE_OK but doesn't insert a record.
>
> Make up a simpler TABLE and try inserting into that one.  A table with one
> INTEGER column ?  In fact, see if you can get any INSERT command working at
> all, then work your way up to one that doesn't work and see if you can find
> the thing that makes the INSERT stops working.
>
> Simon.
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-27 Thread Simon Slavin

On 27 Apr 2013, at 8:05am, Igor Korot  wrote:

> No. Using straight insert with values does not work.
> Record still not inserted.

Okay, so you now don't have to worry about parameters, or a sub-select or any 
of those things.  What you have identified is that a simple INSERT with all 
values supplied returns SQLITE_OK but doesn't insert a record.

Make up a simpler TABLE and try inserting into that one.  A table with one 
INTEGER column ?  In fact, see if you can get any INSERT command working at 
all, then work your way up to one that doesn't work and see if you can find the 
thing that makes the INSERT stops working.

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


Re: [sqlite] Programming API vs console

2013-04-27 Thread Igor Korot
Simon,

On Fri, Apr 26, 2013 at 7:48 PM, Simon Slavin  wrote:

>
> On 27 Apr 2013, at 3:29am, Igor Korot  wrote:
>
> > sqlite> SELECT ownerid FROM owners WHERE ownername = 'Team 1' AND id = 1;
> > 53
>
> For testing, kill the sub-select in your INSERT command and just put a 53
> in there.  See if that changes anything.
>

Nope. Record is still not inserted.


>
> > sqlite>
>
> Please retrieve the values returned by
>
> last_insert_rowid()
>
> or the C function
>
> sqlite3_last_insert_rowid(sqlite3*)
>
> before and after the insert and see if the insert changes the value.
>  After doing that ...
>

This insert is inside transaction. It is first query in it and it's only an
insert. There are about 300 updates as well.
So at which point I need to retrieve the last inserted id: right after
insert or when transaction finishes?


>
> Please substitute your INSERT command with the simplest possible INSERT
> command you can think of and see if that has the desired effect.  First try
> one which inserts fixed values.  If that works  properly ...
>

No. Using straight insert with values does not work.
Record still not inserted.

Thank you.

>
> Try putting the sub-SELECT back in.  Then try putting in one of the
> parameters.  Then add more parameters.  See if you can spot the point at
> which the command stops working.
>
> Simon.
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-26 Thread Simon Slavin

On 27 Apr 2013, at 3:29am, Igor Korot  wrote:

> sqlite> SELECT ownerid FROM owners WHERE ownername = 'Team 1' AND id = 1;
> 53

For testing, kill the sub-select in your INSERT command and just put a 53 in 
there.  See if that changes anything.

> sqlite>

Please retrieve the values returned by

last_insert_rowid()

or the C function

sqlite3_last_insert_rowid(sqlite3*)

before and after the insert and see if the insert changes the value.  After 
doing that ...

Please substitute your INSERT command with the simplest possible INSERT command 
you can think of and see if that has the desired effect.  First try one which 
inserts fixed values.  If that works  properly ...

Try putting the sub-SELECT back in.  Then try putting in one of the parameters. 
 Then add more parameters.  See if you can spot the point at which the command 
stops working.

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


Re: [sqlite] Programming API vs console

2013-04-26 Thread Igor Korot
Simon,

On Fri, Apr 26, 2013 at 5:49 PM, Simon Slavin  wrote:

>
> On 27 Apr 2013, at 12:27am, Igor Korot  wrote:
>
> > And here is the log from the console:
> >
> > SQLite version 3.7.14 2012-09-03 15:42:36
> > Enter ".help" for instructions
> > Enter SQL statements terminated with a ";"
> > sqlite> INSERT INTO playersdrafted VALUES( 125, 1, ( SELECT ownerid FROM
> > owners WHERE ownername = "Team 1" AND id = 1 ), 38, 1, "OF" );
> > sqlite> SELECT * FROM playersdrafted;
> > 125|1|53|38.0|1|OF
> >
> > I can give a remote access to solve this mistery...
>
> Literal strings in SQLite should be in single quotes, not double quotes.
>  So first change that and see if that fixes it.
>

This code


int res;
query = wxString::Format( "INSERT INTO playersdrafted
VALUES( %d, %d, ( SELECT ownerid FROM owners WHERE ownername = \'%s\' AND
id = %d ), %d, %d, \'%s\' );", player.GetPlayerId(), leagueId,
const_cast( player ).GetOwner(), leagueId,
player.GetAmountPaid(), player.GetDraftOrder(), const_cast(
player ).GetDraftedPosition() );
char *error;
res = sqlite3_exec( m_handle, query, 0, 0,  );
if( res != SQLITE_OK )
{
wxMessageBox( wxString::Format( "Error inserting owners
for the new league: %s", error ) );
delete error;
}
else
{
res = sqlite3_prepare_v2( m_handle, "SELECT * FROM
playersdrafted;", -1, , 0 );
if( res == SQLITE_OK )
{
res = sqlite3_step( stmt );
if( res == SQLITE_ROW )
{
int playerid = sqlite3_column_int( stmt, 0 );
int leagueid = sqlite3_column_int( stmt, 1 );
}
}
}


executes fine. No problem at all. Under the debugger I can even see the
proper values of playerid and leagueid.
But on the next run the retrieval of this record is not done as the table
does not have it.
And trying to query table in the console sqlite3 does not yield any results.


> If not ...
>
> show us the results of the command .schema playersdrafted
>
> show is the results of "SELECT * FROM playersdrafted;" /before/ you do the
> INSERT.
>

Here it is:

SQLite version 3.7.14 2012-09-03 15:42:36
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema playersdrafted
CREATE TABLE playersdrafted(playerid integer, id ineteger, ownerid integer,
draftprice double, draftorder integer, draftposition char(2), foreign
key(playerid) references players(playerid),foreign key(id) references
leagues(id), foreign key (ownerid) references owners(ownerid));
CREATE INDEX id_playerid ON playersdrafted(playerid,id);
sqlite> SELECT * FROM playersdrafted;
sqlite>


>
> and also the results of
>
> SELECT ownerid FROM owners WHERE ownername = 'Team 1' AND id = 1
>

and here

sqlite> SELECT ownerid FROM owners WHERE ownername = 'Team 1' AND id = 1;
53
sqlite>

Thank you.


> Simon.
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-26 Thread Simon Slavin

On 27 Apr 2013, at 12:27am, Igor Korot  wrote:

> And here is the log from the console:
> 
> SQLite version 3.7.14 2012-09-03 15:42:36
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> INSERT INTO playersdrafted VALUES( 125, 1, ( SELECT ownerid FROM
> owners WHERE ownername = "Team 1" AND id = 1 ), 38, 1, "OF" );
> sqlite> SELECT * FROM playersdrafted;
> 125|1|53|38.0|1|OF
> 
> I can give a remote access to solve this mistery...

Literal strings in SQLite should be in single quotes, not double quotes.  So 
first change that and see if that fixes it.

If not ...

show us the results of the command .schema playersdrafted

show is the results of "SELECT * FROM playersdrafted;" /before/ you do the 
INSERT.

and also the results of

SELECT ownerid FROM owners WHERE ownername = 'Team 1' AND id = 1

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


Re: [sqlite] Programming API vs console

2013-04-26 Thread Igor Korot
And here is the log from the console:

SQLite version 3.7.14 2012-09-03 15:42:36
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> INSERT INTO playersdrafted VALUES( 125, 1, ( SELECT ownerid FROM
owners WHERE ownername = "Team 1" AND id = 1 ), 38, 1, "OF" );
sqlite> SELECT * FROM playersdrafted;
125|1|53|38.0|1|OF

I can give a remote access to solve this mistery...

Thank you.

On Fri, Apr 26, 2013 at 12:31 AM, Igor Korot  wrote:

> Hi, ALL,
>
> On Thu, Apr 25, 2013 at 2:41 PM, Random Coder wrote:
>
>> On Tue, Apr 23, 2013 at 8:47 PM, Igor Korot  wrote:
>>
>> > query = wxString::Format(...);
>> > if( ( result = sqlite3_prepare_v2( m_handle, query, -1, , 0 ) ) !=
>> > SQLITE_OK )
>> >
>>
>> It's been a while since I've worked with wxWidgets, but when I did,
>> wxString didn't support an implicit conversion like you're using here.
>>
>> You need to do something like this for your sqlite_prepare_v2 call:
>>
>> sqlite3_prepare_v2(m_handle, (const char*)query.mb_str(wxConvUTF8), -1,
>> , 0);
>>
>> Though, I suppose if I'm right, this should have failed in some other way
>> much sooner.
>>
>
> Here is the table description:
>
> sqlite> .dump playersdrafted
> PRAGMA foreign_keys=OFF;
> BEGIN TRANSACTION;
> CREATE TABLE playersdrafted(playerid integer, id ineteger, ownerid
> integer, draftprice double, draftorder integer, draftposition char(2),
> foreign key(playerid) references players(playerid),foreign key(id)
> references leagues(id), foreign key (ownerid) references owners(ownerid));
> CREATE INDEX id_playerid ON playersdrafted(playerid,id);
> COMMIT;
>
> All primary keys are exist by the time the INSERT INTO.. happens.
>
> I even tried to do with sqlite3_exec(), but it is still failing
>
> Any idea?
>
> Thank you.
>
>> ___
>> 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


Re: [sqlite] Programming API vs console

2013-04-26 Thread Igor Korot
Hi, ALL,

On Thu, Apr 25, 2013 at 2:41 PM, Random Coder wrote:

> On Tue, Apr 23, 2013 at 8:47 PM, Igor Korot  wrote:
>
> > query = wxString::Format(...);
> > if( ( result = sqlite3_prepare_v2( m_handle, query, -1, , 0 ) ) !=
> > SQLITE_OK )
> >
>
> It's been a while since I've worked with wxWidgets, but when I did,
> wxString didn't support an implicit conversion like you're using here.
>
> You need to do something like this for your sqlite_prepare_v2 call:
>
> sqlite3_prepare_v2(m_handle, (const char*)query.mb_str(wxConvUTF8), -1,
> , 0);
>
> Though, I suppose if I'm right, this should have failed in some other way
> much sooner.
>

Here is the table description:

sqlite> .dump playersdrafted
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE playersdrafted(playerid integer, id ineteger, ownerid integer,
draftprice double, draftorder integer, draftposition char(2), foreign
key(playerid) references players(playerid),foreign key(id) references
leagues(id), foreign key (ownerid) references owners(ownerid));
CREATE INDEX id_playerid ON playersdrafted(playerid,id);
COMMIT;

All primary keys are exist by the time the INSERT INTO.. happens.

I even tried to do with sqlite3_exec(), but it is still failing

Any idea?

Thank you.

> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-25 Thread Random Coder
On Tue, Apr 23, 2013 at 8:47 PM, Igor Korot  wrote:

> query = wxString::Format(...);
> if( ( result = sqlite3_prepare_v2( m_handle, query, -1, , 0 ) ) !=
> SQLITE_OK )
>

It's been a while since I've worked with wxWidgets, but when I did,
wxString didn't support an implicit conversion like you're using here.

You need to do something like this for your sqlite_prepare_v2 call:

sqlite3_prepare_v2(m_handle, (const char*)query.mb_str(wxConvUTF8), -1,
, 0);

Though, I suppose if I'm right, this should have failed in some other way
much sooner.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Programming API vs console

2013-04-25 Thread Igor Korot
Hi,

On Thu, Apr 25, 2013 at 1:09 PM,  wrote:

> Am 2013-04-25 21:43, schrieb Igor Korot:
>
>  Hi,
>>
>> On Thu, Apr 25, 2013 at 12:31 PM,  wrote:
>>
>>  Am 2013-04-25 21:25, schrieb Igor Korot:
>>>
>>> Simon,
>>>

 On Wed, Apr 24, 2013 at 7:34 PM, Simon Slavin 
 wrote:


  On 25 Apr 2013, at 3:28am, Igor Korot  wrote:
>
> > Changed. No difference at all. Record is still does not show up.
>
> My guess is that you are opening different files in the shell and your
> app.  This is usually caused by a default file path not being what you
> think it is.
>
> Use one program to insert a new row in the table.  Use a simple SELECT
> in
> both programs to see if you can retrieve this new row it.
>
>
>  Nope. It is one file.
 Besides the next time I am running the application at start I am reading
 this table. Record is not present.


>>> Is this by chance on Windows 7, and do you probably Run in /Program
>>> Files/
>>> ?
>>>
>>>
>> Yes, it is Windows 7 64-bit, but no I don't run from C:\Progra~ ;-)
>>
>
> ..and also you don't store there nor in ProgramData?
>

Nope.

Thank you.


> Well..Then at least it is not related to UAC or Virtualization.. ..:-)
>
>
>> Thank you.
>>
>>
>>
>>> Marcus
>>>
>>>
>>>
>>>  Thank you.



  Simon.
> ___
> 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-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-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


Re: [sqlite] Programming API vs console

2013-04-25 Thread Mgrimm

Am 2013-04-25 21:43, schrieb Igor Korot:

Hi,

On Thu, Apr 25, 2013 at 12:31 PM,  wrote:


Am 2013-04-25 21:25, schrieb Igor Korot:

Simon,


On Wed, Apr 24, 2013 at 7:34 PM, Simon Slavin 


wrote:



On 25 Apr 2013, at 3:28am, Igor Korot  wrote:

> Changed. No difference at all. Record is still does not show up.

My guess is that you are opening different files in the shell and 
your
app.  This is usually caused by a default file path not being what 
you

think it is.

Use one program to insert a new row in the table.  Use a simple 
SELECT in

both programs to see if you can retrieve this new row it.



Nope. It is one file.
Besides the next time I am running the application at start I am 
reading

this table. Record is not present.



Is this by chance on Windows 7, and do you probably Run in /Program 
Files/

?



Yes, it is Windows 7 64-bit, but no I don't run from C:\Progra~ ;-)


..and also you don't store there nor in ProgramData?
Well..Then at least it is not related to UAC or Virtualization.. ..:-)



Thank you.




Marcus




Thank you.




Simon.
__**_
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-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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Programming API vs console

2013-04-25 Thread Igor Korot
Hi,

On Thu, Apr 25, 2013 at 12:31 PM,  wrote:

> Am 2013-04-25 21:25, schrieb Igor Korot:
>
> Simon,
>>
>> On Wed, Apr 24, 2013 at 7:34 PM, Simon Slavin 
>> wrote:
>>
>>
>>> On 25 Apr 2013, at 3:28am, Igor Korot  wrote:
>>>
>>> > Changed. No difference at all. Record is still does not show up.
>>>
>>> My guess is that you are opening different files in the shell and your
>>> app.  This is usually caused by a default file path not being what you
>>> think it is.
>>>
>>> Use one program to insert a new row in the table.  Use a simple SELECT in
>>> both programs to see if you can retrieve this new row it.
>>>
>>>
>> Nope. It is one file.
>> Besides the next time I am running the application at start I am reading
>> this table. Record is not present.
>>
>
> Is this by chance on Windows 7, and do you probably Run in /Program Files/
> ?
>

Yes, it is Windows 7 64-bit, but no I don't run from C:\Progra~ ;-)

Thank you.


>
> Marcus
>
>
>
>> Thank you.
>>
>>
>>
>>> Simon.
>>> __**_
>>> 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-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


Re: [sqlite] Programming API vs console

2013-04-25 Thread Mgrimm

Am 2013-04-25 21:25, schrieb Igor Korot:

Simon,

On Wed, Apr 24, 2013 at 7:34 PM, Simon Slavin  
wrote:




On 25 Apr 2013, at 3:28am, Igor Korot  wrote:

> Changed. No difference at all. Record is still does not show up.

My guess is that you are opening different files in the shell and 
your
app.  This is usually caused by a default file path not being what 
you

think it is.

Use one program to insert a new row in the table.  Use a simple 
SELECT in

both programs to see if you can retrieve this new row it.



Nope. It is one file.
Besides the next time I am running the application at start I am 
reading

this table. Record is not present.


Is this by chance on Windows 7, and do you probably Run in /Program 
Files/ ?


Marcus



Thank you.




Simon.
___
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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Programming API vs console

2013-04-25 Thread Igor Korot
Simon,

On Wed, Apr 24, 2013 at 7:34 PM, Simon Slavin  wrote:

>
> On 25 Apr 2013, at 3:28am, Igor Korot  wrote:
>
> > Changed. No difference at all. Record is still does not show up.
>
> My guess is that you are opening different files in the shell and your
> app.  This is usually caused by a default file path not being what you
> think it is.
>
> Use one program to insert a new row in the table.  Use a simple SELECT in
> both programs to see if you can retrieve this new row it.
>

Nope. It is one file.
Besides the next time I am running the application at start I am reading
this table. Record is not present.

Thank you.


>
> Simon.
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Simon Slavin

On 25 Apr 2013, at 3:28am, Igor Korot  wrote:

> Changed. No difference at all. Record is still does not show up.

My guess is that you are opening different files in the shell and your app.  
This is usually caused by a default file path not being what you think it is.

Use one program to insert a new row in the table.  Use a simple SELECT in both 
programs to see if you can retrieve this new row it.

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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Igor Korot
Simon,

On Wed, Apr 24, 2013 at 5:56 PM, Simon Slavin  wrote:

>
> On 25 Apr 2013, at 1:54am, Igor Korot  wrote:
>
> > Then why this query works in the command prompt console? I don't have
> "Team
> > 1" column name in any of the tables.
> > Nevertheless I'm going to change this and all other queries that use the
> > string literals ot use
> > sqlite3_bind_text() function and see if it will fix the issue.
>
> As a fast fix, just change the " to ' .  See if that makes any difference.
>

Changed. No difference at all. Record is still does not show up.

Thank you.


>
> Simon.
>
>
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Simon Slavin

On 25 Apr 2013, at 1:54am, Igor Korot  wrote:

> Then why this query works in the command prompt console? I don't have "Team
> 1" column name in any of the tables.
> Nevertheless I'm going to change this and all other queries that use the
> string literals ot use
> sqlite3_bind_text() function and see if it will fix the issue.

As a fast fix, just change the " to ' .  See if that makes any difference.

Simon.


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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Igor Korot
James,

On Wed, Apr 24, 2013 at 4:39 PM, James K. Lowden
wrote:

> On Wed, 24 Apr 2013 07:20:59 -0500
> "Jay A. Kreibich"  wrote:
>
> > > query = wxString::Format( "INSERT INTO playersdrafted VALUES( %d, %
> > > d, ( SELECT ownerid FROM owners WHERE ownername = \"%s\" AND id = %
> > > d ), %d, %d, \"%s\" );", player.GetPlayerId(), leagueId,
> > > const_cast( player ).GetOwner(), leagueId,
> > > player.GetAmountPaid(), player.GetDraftOrder(), const_cast > > &>( player ).GetDraftedPosition() );
> >
> >   Two side comments:
> >
> >   1) SQL string-literals use ' not ".
>
> Actually, that may be why the row is not inserted.
>
> WHERE ownername = "Bonaparte"
>
> The double-quoted string, according to SQL rules, is an identifier --
> in this case, a column name -- not a string constant.  If you happen to
> have a column named "Bonaparte" (in my example), the query would parse,
> but probably not do what you want.
>

Then why this query works in the command prompt console? I don't have "Team
1" column name in any of the tables.
Nevertheless I'm going to change this and all other queries that use the
string literals ot use
sqlite3_bind_text() function and see if it will fix the issue.

Thank you.


>
> Maybe your SELECT isn't returning a row?
>
> --jkl
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-24 Thread James K. Lowden
On Wed, 24 Apr 2013 07:20:59 -0500
"Jay A. Kreibich"  wrote:

> > query = wxString::Format( "INSERT INTO playersdrafted VALUES( %d, %
> > d, ( SELECT ownerid FROM owners WHERE ownername = \"%s\" AND id = %
> > d ), %d, %d, \"%s\" );", player.GetPlayerId(), leagueId,
> > const_cast( player ).GetOwner(), leagueId,
> > player.GetAmountPaid(), player.GetDraftOrder(), const_cast > &>( player ).GetDraftedPosition() );
> 
>   Two side comments:
> 
>   1) SQL string-literals use ' not ".

Actually, that may be why the row is not inserted.  

WHERE ownername = "Bonaparte" 

The double-quoted string, according to SQL rules, is an identifier --
in this case, a column name -- not a string constant.  If you happen to
have a column named "Bonaparte" (in my example), the query would parse,
but probably not do what you want.  

Maybe your SELECT isn't returning a row?  

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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Igor Korot
On Wed, Apr 24, 2013 at 12:59 PM, Igor Korot  wrote:

> Clemens,
>
> On Wed, Apr 24, 2013 at 12:21 PM, Clemens Ladisch wrote:
>
>> Igor Korot wrote:
>>  On Wed, Apr 24, 2013 at 12:50 AM, Clemens Ladisch <
>> clem...@ladisch.de
>>  wrote:
>> > Igor Korot wrote:
>> >> ...
>> >> else
>> >>  sqlite3_step( stmt );
>> >
>> > You forgot to check for errors.
>> > I guess the code that executes the COMMIT has the same bug.
>> >
>> > sqlite3_step() returns 101 which means SQLITE_DONE and
>> sqlite3_finalize()
>> > return 0 which is SQLITE_OK.
>>
>> And the COMMIT?
>>
>
> Same values. sqlite3_step() - 101, sqlite3_finalize() - 0.
>

Doing SELECT from command prompt console does not return any records. :(


>
> Thank you.
>
>
>>
>>
>> Regards,
>> Clemens
>> ___
>> 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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Igor Korot
Clemens,

On Wed, Apr 24, 2013 at 12:21 PM, Clemens Ladisch wrote:

> Igor Korot wrote:
>  On Wed, Apr 24, 2013 at 12:50 AM, Clemens Ladisch   wrote:
> > Igor Korot wrote:
> >> ...
> >> else
> >>  sqlite3_step( stmt );
> >
> > You forgot to check for errors.
> > I guess the code that executes the COMMIT has the same bug.
> >
> > sqlite3_step() returns 101 which means SQLITE_DONE and sqlite3_finalize()
> > return 0 which is SQLITE_OK.
>
> And the COMMIT?
>

Same values. sqlite3_step() - 101, sqlite3_finalize() - 0.

Thank you.


>
>
> Regards,
> Clemens
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Clemens Ladisch
Igor Korot wrote:
 On Wed, Apr 24, 2013 at 12:50 AM, Clemens Ladisch  Igor Korot wrote:
>> ...
>> else
>>  sqlite3_step( stmt );
>
> You forgot to check for errors.
> I guess the code that executes the COMMIT has the same bug.
>
> sqlite3_step() returns 101 which means SQLITE_DONE and sqlite3_finalize()
> return 0 which is SQLITE_OK.

And the COMMIT?


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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Igor Korot
Hi, ALL,

On Wed, Apr 24, 2013 at 11:11 AM, Igor Korot  wrote:

>
>
> On Wed, Apr 24, 2013 at 3:54 AM, Clemens Ladisch wrote:
>
>> Igor Korot wrote:
>> > Clement,
>>
>> Who?  ;-)
>>
>
> Oops...
> I promise I will never write an E-mail at 1:00 AM  ;-)
>
>
>> > On Wed, Apr 24, 2013 at 12:50 AM, Clemens Ladisch > >wrote:
>> >> Igor Korot wrote:
>> >>> ...
>> >>> else
>> >>>  sqlite3_step( stmt );
>> >>
>> >> You forgot to check for errors.
>> >> I guess the code that executes the COMMIT has the same bug.
>> >
>> > I am checking the error.
>> > It is from the sqlite3_prepare_v2().
>> >
>> > Are you saying I have to check sqlite3_step() also?
>>
>> sqlite3_prepare_v2() just parses the statement.  When it succeeds, you
>> just know that your SQL is syntactically correct.
>>
>> It does not get executed until the sqlite3_step() call.
>>
>
> OK, thanx.
> Will check and post here if it's something I don't know.
>

sqlite3_step() returns 101 which means SQLITE_DONE and sqlite3_finalize()
return 0 which is SQLITE_OK.
What else can I do?

Thank you.


>
>>
>>
>> Regards,
>> Clemens
>> ___
>> 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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Igor Korot
On Wed, Apr 24, 2013 at 3:54 AM, Clemens Ladisch  wrote:

> Igor Korot wrote:
> > Clement,
>
> Who?  ;-)
>

Oops...
I promise I will never write an E-mail at 1:00 AM  ;-)


> > On Wed, Apr 24, 2013 at 12:50 AM, Clemens Ladisch  >wrote:
> >> Igor Korot wrote:
> >>> ...
> >>> else
> >>>  sqlite3_step( stmt );
> >>
> >> You forgot to check for errors.
> >> I guess the code that executes the COMMIT has the same bug.
> >
> > I am checking the error.
> > It is from the sqlite3_prepare_v2().
> >
> > Are you saying I have to check sqlite3_step() also?
>
> sqlite3_prepare_v2() just parses the statement.  When it succeeds, you
> just know that your SQL is syntactically correct.
>
> It does not get executed until the sqlite3_step() call.
>

OK, thanx.
Will check and post here if it's something I don't know.


>
>
> Regards,
> Clemens
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Igor Tandetnik

On 4/24/2013 12:45 AM, Igor Korot wrote:

In the beginning I'm issuing "BEGIN". In the end if everything is good I'm
issuing "COMMIT", if not "ROLLBACK".
So when running under debugger in Visual Studio, right after sqlite3_step()
call I am issuing SELECT * FROM playersdrafted in the console.
It comes back empty.


This is normal. A connection wouldn't see the changes made by an 
uncommitted transaction on another connection.



Upon restarting the program and going thru the same algorithm,  I let it
run after "COMMIT" and then query the table.
It still comes back empty.


This is not normal. Once the transaction is committed, changes should be 
visible.


Verify that you are actually looking at the same file in both places, 
and not, say, two files with the same name in different directories. For 
one thing, check last-modified timestamp on the DB file that you open in 
the console - it should get bumped up every time your program runs.

--
Igor Tandetnik

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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Jay A. Kreibich
On Tue, Apr 23, 2013 at 08:47:18PM -0700, Igor Korot scratched on the wall:

> Here is the code:
> 
> query = wxString::Format( "INSERT INTO playersdrafted VALUES( %d, %d, (
> SELECT ownerid FROM owners WHERE ownername = \"%s\" AND id = %d ), %d, %d,
> \"%s\" );", player.GetPlayerId(), leagueId, const_cast( player
> ).GetOwner(), leagueId, player.GetAmountPaid(), player.GetDraftOrder(),
> const_cast( player ).GetDraftedPosition() );

  Two side comments:

  1) SQL string-literals use ' not ".

  2) Using string manipulation functions to build statements is really
 bad form and can easily open the code up to SQL injection attacks
 and other problems.  For example, if a player's owner string has a
 quote in it, this code won't work.  Using bound parameters fixes
 all this.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Programming API vs console

2013-04-24 Thread Simon Slavin

On 24 Apr 2013, at 4:47am, Igor Korot  wrote:

> sqlite3_step( stmt );
> sqlite3_finalize( stmt );

Please check the values SQLite returns from the _step and _finalize calls to 
make sure it's not generating an error.

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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Clemens Ladisch
Igor Korot wrote:
> Clement,

Who?  ;-)

> On Wed, Apr 24, 2013 at 12:50 AM, Clemens Ladisch wrote:
>> Igor Korot wrote:
>>> ...
>>> else
>>>  sqlite3_step( stmt );
>>
>> You forgot to check for errors.
>> I guess the code that executes the COMMIT has the same bug.
>
> I am checking the error.
> It is from the sqlite3_prepare_v2().
>
> Are you saying I have to check sqlite3_step() also?

sqlite3_prepare_v2() just parses the statement.  When it succeeds, you
just know that your SQL is syntactically correct.

It does not get executed until the sqlite3_step() call.


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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Igor Korot
Clement,

On Wed, Apr 24, 2013 at 12:50 AM, Clemens Ladisch wrote:

> Igor Korot wrote:
> > ...
> > else
> >  sqlite3_step( stmt );
>
> You forgot to check for errors.
> I guess the code that executes the COMMIT has the same bug.
>

I am checking the error.
It is from the sqlite3_prepare_v2().

Are you saying I have to check sqlite3_step() also?

Thank you.


>
>
> Regards,
> Clemens
> ___
> 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


Re: [sqlite] Programming API vs console

2013-04-24 Thread Clemens Ladisch
Igor Korot wrote:
> ...
> else
>  sqlite3_step( stmt );

You forgot to check for errors.
I guess the code that executes the COMMIT has the same bug.


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


Re: [sqlite] Programming API vs console

2013-04-23 Thread Igor Korot
Hi, Igor,

On Tue, Apr 23, 2013 at 8:55 PM, Igor Tandetnik  wrote:

> On 4/23/2013 11:47 PM, Igor Korot wrote:
>
>> During the program flow I need to insert a record in one of the tables
>> inside transaction.
>> Record inserts OK (no error message generated), but when I try to check
>> using the SQLite
>> console the record is not present.
>> I let the transaction finish and check using the console program - record
>> is still not present.
>>
>
> What exactly does "let the transaction finish" mean? Do you issue a COMMIT
> or END statement? What you describe looks very much like the program
> terminates leaving an uncommitted transaction behind, which is then rolled
> back.
>

In the beginning I'm issuing "BEGIN". In the end if everything is good I'm
issuing "COMMIT", if not "ROLLBACK".
So when running under debugger in Visual Studio, right after sqlite3_step()
call I am issuing SELECT * FROM playersdrafted in the console.
It comes back empty.
Upon restarting the program and going thru the same algorithm,  I let it
run after "COMMIT" and then query the table.
It still comes back empty.

Hopefully it explains it.

Thank you.

-- 
> Igor Tandetnik
>
> __**_
> 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


Re: [sqlite] Programming API vs console

2013-04-23 Thread Igor Tandetnik

On 4/23/2013 11:47 PM, Igor Korot wrote:

During the program flow I need to insert a record in one of the tables
inside transaction.
Record inserts OK (no error message generated), but when I try to check
using the SQLite
console the record is not present.
I let the transaction finish and check using the console program - record
is still not present.


What exactly does "let the transaction finish" mean? Do you issue a 
COMMIT or END statement? What you describe looks very much like the 
program terminates leaving an uncommitted transaction behind, which is 
then rolled back.

--
Igor Tandetnik

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