Re: [sqlite] VC++ and SQLite

2012-11-13 Thread Arbol One
I would also keep this feature, however, in the case of SQLite3 amalgamation, I 
am really confused. You know how we have to #include the 'stdafx.h' in every 
declaration file (making it non-portable code), i.e. .c, .cpp, etc., well, I 
tried doing the same thing with sqlite.c, but VS10 complains about it. 

What a nightmare Visual Studio is :(

Genius might have limitations, but stupidity is no handicap
Eat Kosher

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of John Drescher
Sent: Monday, November 12, 2012 7:44 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] VC++ and SQLite

On Mon, Nov 12, 2012 at 1:52 PM, Doug Nebeker pa...@poweradmin.com wrote:
 You might be surprised at the speed increase you see in compile time 
 if you've got large projects.  The time isn't lost to CPU as much, but 
 disk I/O time adds up when hitting many hundreds of small (header) 
 files (even with an SSD).


This is why I use PCH. Building some of my projects take a long time even on a 
12 threaded processor with multiple SSDs.


--
John M. Drescher
___
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] VC++ and SQLite

2012-11-13 Thread Arbol One
Following the advice of MSN:
Open the project's Property Pages dialog box. For details, see Setting Visual 
C++ Project Properties. 
Click the C/C++ folder. 
Click the Advanced property page. 
Modify the Force Includes property. 

and now my Force Include property text entry box has the word: stdafx.h

This now produces the following error:
fatal error C1083: Cannot open include file: 'stdafx.h': No such file or 
directory
1  strtools.cpp.
What else needs to be changed now?

PD
Why is MS paying people to create software that is s complicated to use?
I am 100% sure that if I was using Code::Blocks or Dev-Cpp or any other IDE I 
would be making money already. Instead, I have to not-make money while learning 
how to use VS10 Express. If MS intends to help developers, why not make things 
less elegant?
One thing is for sure, I would have already fired the motherf!@#$ who is 
responsible for the development of an application so repudiated that people 
prefer other's, even when I give it out for free!


Genius might have limitations, but stupidity is no handicap
Eat Kosher


-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Michael Schlenker
Sent: Tuesday, November 13, 2012 8:57 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] VC++ and SQLite

Am 13.11.2012 14:33, schrieb Arbol One:
 I would also keep this feature, however, in the case of SQLite3 
 amalgamation, I am really confused. You know how we have to #include 
 the 'stdafx.h' in every declaration file (making it non-portable 
 code), i.e. .c, .cpp, etc., well, I tried doing the same thing with 
 sqlite.c, but VS10 complains about it.

You can do that without making it non portable by adding /FI to your compile 
line:
http://msdn.microsoft.com/en-us/library/8c5ztk84%28v=vs.71%29.aspx

Try /FI stdafx.h

Michael

 
 What a nightmare Visual Studio is :(
 
 Genius might have limitations, but stupidity is no handicap Eat Kosher
 
 -Original Message- From: sqlite-users-boun...@sqlite.org 
 [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of John Drescher
 Sent: Monday, November 12, 2012 7:44 PM To: General Discussion of 
 SQLite Database Subject: Re: [sqlite] VC++ and SQLite
 
 On Mon, Nov 12, 2012 at 1:52 PM, Doug Nebeker pa...@poweradmin.com
 wrote:
 You might be surprised at the speed increase you see in compile time 
 if you've got large projects.  The time isn't lost to CPU as much, 
 but disk I/O time adds up when hitting many hundreds of small
 (header) files (even with an SSD).
 
 
 This is why I use PCH. Building some of my projects take a long time 
 even on a 12 threaded processor with multiple SSDs.
 
 
 -- John M. Drescher ___
 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
 


--
Michael Schlenker
Software Architect

CONTACT Software GmbH   Tel.:   +49 (421) 20153-80
Wiener Straße 1-3   Fax:+49 (421) 20153-41
28359 Bremen
http://www.contact.de/  E-Mail: m...@contact.de

Sitz der Gesellschaft: Bremen
Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe Eingetragen im 
Handelsregister des Amtsgerichts Bremen unter HRB 13215 
___
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] VC++ and SQLite

2012-11-13 Thread Arbol One
Not to recompile it again?
You know, the concept of precompiled headres...?

Genius might have limitations, but stupidity is no handicap
Eat Kosher


-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Noel Frankinet
Sent: Tuesday, November 13, 2012 9:19 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] VC++ and SQLite

why would you need stdafx.h for sqlite ? what is the added benefit ?


On 13 November 2012 14:57, Michael Schlenker m...@contact.de wrote:

 Am 13.11.2012 14:33, schrieb Arbol One:
  I would also keep this feature, however, in the case of SQLite3 
  amalgamation, I am really confused. You know how we have to #include 
  the 'stdafx.h' in every declaration file (making it non-portable 
  code), i.e. .c, .cpp, etc., well, I tried doing the same thing with 
  sqlite.c, but VS10 complains about it.

 You can do that without making it non portable by adding /FI to your 
 compile line:
 http://msdn.microsoft.com/en-us/library/8c5ztk84%28v=vs.71%29.aspx

 Try /FI stdafx.h

 Michael

 
  What a nightmare Visual Studio is :(
 
  Genius might have limitations, but stupidity is no handicap Eat 
  Kosher
 
  -Original Message- From: sqlite-users-boun...@sqlite.org 
  [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of John Drescher
  Sent: Monday, November 12, 2012 7:44 PM To: General Discussion of 
  SQLite Database Subject: Re: [sqlite] VC++ and SQLite
 
  On Mon, Nov 12, 2012 at 1:52 PM, Doug Nebeker pa...@poweradmin.com
  wrote:
  You might be surprised at the speed increase you see in compile 
  time if you've got large projects.  The time isn't lost to CPU as 
  much, but disk I/O time adds up when hitting many hundreds of small
  (header) files (even with an SSD).
 
 
  This is why I use PCH. Building some of my projects take a long time 
  even on a 12 threaded processor with multiple SSDs.
 
 
  -- John M. Drescher ___
  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
 


 --
 Michael Schlenker
 Software Architect

 CONTACT Software GmbH   Tel.:   +49 (421) 20153-80
 Wiener Straße 1-3   Fax:+49 (421) 20153-41
 28359 Bremen
 http://www.contact.de/  E-Mail: m...@contact.de

 Sitz der Gesellschaft: Bremen
 Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe Eingetragen im 
 Handelsregister des Amtsgerichts Bremen unter HRB 13215 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users




--
Noël Frankinet
Strategis sprl
0478/90.92.54
___
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] VC++ and SQLite

2012-11-13 Thread Arbol One
I used Borland when I was a student too and a little bit after I graduated, I 
used OWL once, what a mistake, soon after Borland dropped the ball on OWL; left 
me stranded. Ever since I use GNU and GTKmm, they appear to be much more stable 
than Borland. Microsoft is stable, no doubt, but too complicated; just have a 
look at the madness of MFC or try to play a sound file using WIN API code. No 
man, I am not an advocate for anyone but me and what I find to be good. I am 
not loyal to companies or consortiums; I am loyal to me and what I find to be 
good to me.

MS was never free before FSF pushed it to give a bit of its millions of $ back, 
after that, even MS-Windows started to feel like Linux. Linux proved to be just 
as good as, and some times better than MS.

Linux developers didn't need the complexity of VS10 or a simple IDE like 
Code::Blocks to create or participate in the creation of an OS so much better 
than those using VS to develop theirs.
MS-VS developers should spend more time creating more effective documentation 
and less time developing a new Language/Dialect for the IT industry.

Genius might have limitations, but stupidity is no handicap
Eat Kosher


-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of John Drescher
Sent: Tuesday, November 13, 2012 9:57 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] VC++ and SQLite

On Tue, Nov 13, 2012 at 8:51 AM, Arbol One arbol...@gmail.com wrote:
 Following the advice of MSN:
 Open the project's Property Pages dialog box. For details, see Setting Visual 
 C++ Project Properties.
 Click the C/C++ folder.
 Click the Advanced property page.
 Modify the Force Includes property.

 and now my Force Include property text entry box has the word: 
 stdafx.h

 This now produces the following error:
 fatal error C1083: Cannot open include file: 'stdafx.h': No such file 
 or directory
 1  strtools.cpp.
 What else needs to be changed now?

 PD
 Why is MS paying people to create software that is s complicated to use?

The PCH requirements and behavior are the same as they have been since at least 
the mid 1990s but probably longer. Before that I used borland compilers.

John
___
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] VC++ and SQLite

2012-11-13 Thread Arbol One
Further inspection showed that there is a macro that is added, and not the 
stdafx.h file name, the macro is 
'%(PrecompiledHeaderFile);%(ForcedIncludeFiles)'. Nevertheless, VS10 still 
complains with the following error:
fatal error C1853: 'Debug\vsSamiira.pch' precompiled header file is from a 
previous version of the compiler, or the precompiled header is C++ and you are 
using it from C (or vice versa).

How do I solve this problem?

Genius might have limitations, but stupidity is no handicap
Eat Kosher


-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Michael Schlenker
Sent: Tuesday, November 13, 2012 8:57 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] VC++ and SQLite

Am 13.11.2012 14:33, schrieb Arbol One:
 I would also keep this feature, however, in the case of SQLite3 
 amalgamation, I am really confused. You know how we have to #include 
 the 'stdafx.h' in every declaration file (making it non-portable 
 code), i.e. .c, .cpp, etc., well, I tried doing the same thing with 
 sqlite.c, but VS10 complains about it.

You can do that without making it non portable by adding /FI to your compile 
line:
http://msdn.microsoft.com/en-us/library/8c5ztk84%28v=vs.71%29.aspx

Try /FI stdafx.h

Michael

 
 What a nightmare Visual Studio is :(
 
 Genius might have limitations, but stupidity is no handicap Eat Kosher
 
 -Original Message- From: sqlite-users-boun...@sqlite.org 
 [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of John Drescher
 Sent: Monday, November 12, 2012 7:44 PM To: General Discussion of 
 SQLite Database Subject: Re: [sqlite] VC++ and SQLite
 
 On Mon, Nov 12, 2012 at 1:52 PM, Doug Nebeker pa...@poweradmin.com
 wrote:
 You might be surprised at the speed increase you see in compile time 
 if you've got large projects.  The time isn't lost to CPU as much, 
 but disk I/O time adds up when hitting many hundreds of small
 (header) files (even with an SSD).
 
 
 This is why I use PCH. Building some of my projects take a long time 
 even on a 12 threaded processor with multiple SSDs.
 
 
 -- John M. Drescher ___
 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
 


--
Michael Schlenker
Software Architect

CONTACT Software GmbH   Tel.:   +49 (421) 20153-80
Wiener Straße 1-3   Fax:+49 (421) 20153-41
28359 Bremen
http://www.contact.de/  E-Mail: m...@contact.de

Sitz der Gesellschaft: Bremen
Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe Eingetragen im 
Handelsregister des Amtsgerichts Bremen unter HRB 13215 
___
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] VC++ and SQLite

2012-11-10 Thread Arbol One
I know this question is not a SQLite question, but I am hoping that someone 
here has had a similar experience and/or can point me to the right place to ask 
this question.

After years or using Code::Blocks and Dev-Cpp, I have recently installed Visual 
Studio 10 Express; it is the first time I am using it, in my Windows 7 machine. 

I have written, with the help of this mailing list a wrapper class for the 
latest SQLite3 library using C::B as my development platform, now that I want 
to switch to VS10, there were a lot of gcc specific code that I had to repair 
and after clearing all the C++ discrepancies between MinGW's g++ and MS's VC++ 
I have been left with this error message:

fatal error C1853: 'Debug\sql.pch' precompiled header file is from a previous 
version of the compiler, or the precompiled header is C++ and you are using it 
from C (or vice versa

 

Does anyone know how to resolve this issue or perhaps a VS10 specific mailing 
list to address this question?

 

TIA.

 

This e-mail is for the sole use of the intended recipient and may contain 
confidential or privileged information. Unauthorized use of its contents is 
prohibited. If you have received this e-mail in error, please notify sender 
immediately via return e-mail and then delete the original e-mail.

 

Let there come out of you a group of people inviting to all that is good, 
enjoining what is right, and to strive against what is wrong: They are the ones 
to attain respect and admiration, i.e. FSF, GTK+, *NIX, SQLite... etc.

Eat Kosher 
http://www.hanefesh.com/edu/kosher_Food_Symbols.htm#USAD:DocumentsDownloaded 
Installations 

 

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


Re: [sqlite] MyJSQLView Version 3.40 Released

2012-11-01 Thread Arbol One


UNIX is basically a simple operating system, but you have to be a genius to
understand the simplicity - Dennis Ritchie
Genius might have limitations, but stupidity is no handicap
Eat Kosher

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of
da...@dandymadeproductions.com
Sent: Tuesday, October 30, 2012 6:00 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] MyJSQLView Version 3.40 Released

MyJSQLView Version 3.40 Released

The MyJSQLView project is pleased to release v3.40 to the public. The
release marks a major reorganizational effort to the source code and plugin
management. Though the public will notice little with regard to the source
subpackaging the plugin management changes bring the ability to now load
plugins from remote locations. Plugin repositories can now be created by
individuals or organizations that wish to provide custom plugins on the
basis of a realtime network loading capability.
In that regard the MyJSQLView project has added to its own public repository
a free open source plugin that contains a graphical SQL query builder.
MyJSQLView works in conjuction with the Xerial SQLite JDBC to access a
SQlite database file.

Dana M. Proctor
MyJSQLView Project Manager
http://dandymadeproductions.com/projects/MyJSQLView/
http://www.xerial.org

MyJSQLView provides an free open source easy to use Java based user
interface frontend for viewing, adding, editing, or deleting entries in
several mainstream databases. A query frame allows the building of complex
SQL statements and a SQL Query Bucket for saving such. The application
allows easy sorting, searching, and import/export of table data. A plug-in
framework has allowed the inclusion of tools to profile and plot data for
analysis.

___
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] insert if in SQL cmd

2012-10-23 Thread Arbol One
The analogy you have chosen to explain the algorithm of your program is
clear, but it seems to me that you are using a specific computer language to
achieve its goal. Perhaps, it would be much easier on us, the helpers, to
help you if you provide information that is more tangible; as in a snip of
the code.


Genius might have limitations, but stupidity is no handicap


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of YAN HONG YE
Sent: Monday, October 22, 2012 10:01 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] insert if in SQL cmd

I need a function to run step 2 in sql cmd, but I don't know how to write in
the sql environment.

1. BEGIN TRANSACTION;
2. if today is mondy to fridy,then run 3-6
ELSE run 6.
3. prepare and step stmt A (SELECT * FROM foo WHERE rowid=1), A is not
finalized or reset; 4. execute stmt B (DELETE FROM foo WHERE rowid=1), B is
prepared, executed and finalized; 5. access column data via stmt A 6. COMMIT
___
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] Getting Error SQLITE_NOTADB

2012-10-23 Thread Arbol One
Save yourself some time and show some code, it will make it easy for us to
help you.

Genius might have limitations, but stupidity is no handicap



-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of kritesh tripathi
Sent: Tuesday, October 23, 2012 10:32 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Getting Error SQLITE_NOTADB

hi michael

thanks for the responnse bt still getting the same problem

language-C++
RTOS-micro itron
where-creating db in digital camera external sd card and afterwards usin
this db file  for some wifi feature  present in digital camera so that user
can see all those images in tv or mobile.

after debug i find tht in tht if condition using memcmp which compares
between page1 and zmagicheaderbt value of page1= 

is this a problem ?

cheers
kritesh
On Oct 24, 2012 3:57 AM, Black, Michael (IS) michael.bla...@ngc.com
wrote:

 OK...here it is again using an updatestill works for me.  Does it 
 work for you?
 run it like this...first run with no args creates the table simple 
 simple 1 2 simple 2 3

 The args just update from/to values so you can see them changing using 
 and update/where clause.

 #1 What OS?
 #2 What language
 #3 Where's your code?

 #include stdio.h
 #include sqlite3.h

 int main(int argc, char *argv[])
 {
 sqlite3 *db;
 int rc;
 rc=sqlite3_open(test.db,db);
 if (rc != SQLITE_OK) {
 puts(sqlite3_errmsg(db));
 }
 if (argc == 1) {
 sqlite3_exec(db,create table t (i 
 integer);,NULL,NULL,NULL);
 rc=sqlite3_exec(db,insert into t 
 values(1);,NULL,NULL,NULL);
 }
 else {
 char sql[4096];
 if (argc != 3) {
 printf(Need 2 args, old/new values\n);
 exit(1);
 }
 sprintf(sql,update t set i=%s where 
 i=%s,argv[2],argv[1]);
 rc=sqlite3_exec(db,sql,NULL,NULL,NULL);
 }

 if (rc != SQLITE_OK) {
 puts(sqlite3_errmsg(db));
 }
 sqlite3_close(db);
 return 0;
 }

 Michael D. Black
 Senior Scientist
 Advanced Analytics Directorate
 Advanced GEOINT Solutions Operating Unit Northrop Grumman Information 
 Systems

 
 From: sqlite-users-boun...@sqlite.org 
 [sqlite-users-boun...@sqlite.org] on behalf of kritesh tripathi 
 [tripathi.krit...@gmail.com]
 Sent: Tuesday, October 23, 2012 1:44 PM
 To: General Discussion of SQLite Database
 Subject: EXT :Re: [sqlite] Getting Error SQLITE_NOTADB

 hi michale

 there is no problem in creating and inserting the records in table 
 ...but after tht i am trying to update the coloum value of table and 
 using update command with where clause ..here every time sqlite_exec 
 command failing and rc returns in sqlite3_prepare such as 
 SQLITE_NOTADB

 CHEERS
 KRITESH
 On Oct 24, 2012 2:10 AM, Black, Michael (IS) 
 michael.bla...@ngc.com
 wrote:

  I assume you have some program doing the sqlite_exec?
 
  Care to show us your code?
 
 
  I just ran a test doing what you describe with  SQLite Database 
  Browser Version 2.0b1  and the following program compiled against 
  3.7.13;
 
  After the 2nd run of this program there are 2 records in test.db 
  which
 the
  browser showsno errors occur.
 
  #include stdio.h
  #include sqlite3.h
 
  int main()
  {
  sqlite3 *db;
  int rc;
  rc=sqlite3_open(test.db,db);
  if (rc != SQLITE_OK) {
  puts(sqlite3_errmsg(db));
  }
  sqlite3_exec(db,create table t (i integer);,NULL,NULL,NULL);
  rc=sqlite3_exec(db,insert into t values(1);,NULL,NULL,NULL);
  if (rc != SQLITE_OK) {
  puts(sqlite3_errmsg(db));
  }
  sqlite3_close(db);
  }
 
  Michael D. Black
  Senior Scientist
  Advanced Analytics Directorate
  Advanced GEOINT Solutions Operating Unit Northrop Grumman 
  Information Systems
 
  
  From: sqlite-users-boun...@sqlite.org 
  [sqlite-users-boun...@sqlite.org] on behalf of kritesh tripathi 
  [tripathi.krit...@gmail.com]
  Sent: Tuesday, October 23, 2012 11:58 AM
  To: sqlite-users@sqlite.org
  Subject: EXT :[sqlite] Getting Error SQLITE_NOTADB
 
  Hi
 
  I am using Sqlite for my project and getting Error like 
  -SQLITE_NOTADB whenever i am trying below scenario-
 
  1- Open and create the database
  2- Execute Sqlite_Exec to Insert the record in the database table
  3- Close the database
  4- Confirm by opening the .db file in sqlite browser tht dtabase 
  table insert the records
 
 
  5- Again Open the the database
  6- Whenever Executing  Sqlite_Exec  to Update the colum value of
  database
  table .
 
  .Getting the Errror in Sqlite3_Prepare()---lockBtree(BtShared 
  *pBt)--
 
   if( memcmp(page1, zMagicHeader, 16)!=0 ){
goto 

Re: [sqlite] how to unsubscribe?

2012-10-10 Thread Arbol One
Go to:
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

and unsubscribe, that's it.

Genius might have limitations, but stupidity is no handicap
Eat Kosher

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Álvaro García
Sent: Wednesday, October 10, 2012 10:51 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] how to unsubscribe?

Hello:

  I would like to know how can I unsubscribe from this list.



Thanks.

-- 
Álvaro García.
GTS Global Técnicos y Servicios

___
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] C++ - Sqlite3 and Visual Studio 10

2012-10-08 Thread Arbol One
When trying to port my application from Code::Blocks(windows version) to
Visual Studio 10, I am getting some error, similar to the one below:
1my_sqlite3.obj : error LNK2019: unresolved external symbol
_sqlite3_prepare_v2 referenced in function public: bool __thiscall
mySQLite3::notExist(class Glib::ustring const )
(?notExist@mySQLite3@jme@@QAE_NABVustring@Glib@@@Z)

I was hoping someone here might have gone through the same experience and
might be able to help resolve this issue.

TIA

This e-mail is for the sole use of the intended recipient and may contain
confidential or privileged information. Unauthorized use of its contents is
prohibited. If you have received this e-mail in error, please notify sender
immediately via return e-mail and then delete the original e-mail.



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


Re: [sqlite] C++ - Sqlite3 and Visual Studio 10

2012-10-08 Thread Arbol One
yap, that's what it was, thanks!

... work out your salvation with fear and trembling
Eat Kosher

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Clemens Ladisch
Sent: Monday, October 08, 2012 10:43 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ - Sqlite3 and Visual Studio 10

Arbol One wrote:
 error LNK2019: unresolved external symbol _sqlite3_prepare_v2

It appears you forgot to include sqlite3.c in your application.


Regards,
Clemens


 This e-mail is for the sole use of the intended recipient and may 
 contain confidential or privileged information. Unauthorized use of 
 its contents is prohibited. If you have received this e-mail in error, 
 please notify sender immediately via return e-mail and then delete the
original e-mail.

This e-mail contains public information intended for any subscriber of this
mailing list and for anybody else who bothers to read it; it will be copied,
disclosed and distributed to the public.  If you think you are not the
intended recipient, please commit suicide immediately.
These terms apply also to any e-mails quoted in, referenced from, or
answering this e-mail, and supersede any confidentiality notices in those
e-mails.  Additionally, confidentiality notices in those e-mails will incur
legal processing fees of $42 per line; you have agreed to this by reading
this confidentiality notice.
___
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] C++ - HOW MANY rows?

2012-09-12 Thread Arbol One
Look, Sir, I appreciate that you have spend your time and energy responding
to my question, in fact, I have used your suggestion to have a look at the
other guys' C++ wrappers of the SQLite3 library, but my intention is to
learn SQL using the SQLite3 API. I am using C++ and not the 'prompt',
because I will ultimately use C++ to implement my knowledge of SQL and
SQLite3.
Just so that we are clear, I don't mind trying and failing a thousand times,
I need to know how this thing works!
On the other hand, I really like your analogy of the book being opened, the
pages being read and then closing the book again, it is brilliant concept. I
see now that I need to reorganize my class so that I can have the
'finalizer' method called only once at the end of the database transaction.
I hope, and I am counting on everyone here, to eventually release mySQLite3
in the public domain.
Again, thanks so much for your help and have a wonderful day.


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: Tuesday, September 11, 2012 11:24 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ - HOW MANY rows?

Arbol One arbol...@gmail.com wrote:
 Since the call to the sqlite3_step function is inside the 
 mySQLite3::read_* class-function/method

... it is clear that you have a poor class design. As you would generally
want to read several columns from the same row, it is unwise to have a
read_* method call sqlite3_step, thus advancing to the next row. It is even
less wise to have it call sqlite3_prepare and sqlite3_finalize.

 Now, in a while loop inside
 Runner::read_tblName() I could call the mySQLite3::read_* for the data 
 to be retrieved, but instead of reading the next row of data, it keeps 
 on reading the same row again and again.

Because you prepare and finalize the stament again and again. Think about it
this way: sqlite3_prepare call opens a book, sqlite3_step call turns a page,
sqlite3_finalize call closes the book shut. Your read_* method opens the
book, turns to the first page, reads one line, then closes the book. The
next read_* call opens the book again, turns to the first page again, reads
another line, and closes the book. Again, and again.

Is it still surprising that you never progress past the first page?

 Obviously my problem is in design

Indeed.

 but I don't have enough experience using SQLite3 to come up with a better
idea.

In this case, perhaps you should consider using, or at least studying, some
existing libraries. There's no shortage of them:

http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers

--
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] C++ - HOW MANY rows?

2012-09-12 Thread Arbol One
yes, it worked, thanks Michael.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS)
Sent: Wednesday, September 12, 2012 8:13 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ - HOW MANY rows?

Try using this method...you just need to ensure mystmt is set to NULL to
start with and reset to NULL in finalize().


const int mySQLite3::read_int(int pos)
throw(somexception) {
if (mystmt == NULL) { // Ensure mystmt is set to NULL in constructor
  rc = sqlite3_prepare_v2(db, SQLStatement.c_str(), -1, mystmt, NULL);
  if(rc != SQLITE_OK) {
  try {
  this-display(rc, FILE, METHOD, LINE);
  } catch(somexception e) {
  throw e;
  }
  }
} 
rc = sqlite3_step(mystmt);
if(rc == SQLITE_ROW ) {
apint = sqlite3_column_int(mystmt,pos);
counter++;
return apint;
}
if (rc != SQLITE_DONE) {
  this-display(rc,FILE,METHOD,LINE+:+sqlite3_errmsg(db));
}

try {
this-finalize(); // ensure mystmt set to null in finalize
} catch(somexception e) {
throw e;
}
return -1; // how do you know when you're done? Will -1 work?
}


Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Advanced GEOINT Solutions Operating Unit Northrop Grumman Information
Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on
behalf of Arbol One [arbol...@gmail.com]
Sent: Tuesday, September 11, 2012 9:44 PM
To: 'General Discussion of SQLite Database'
Subject: EXT :Re: [sqlite] C++ - HOW MANY rows?

Thanks Igor for your prompt response.
Since the call to the sqlite3_step function is inside the mySQLite3::read_*
class-function/method, I call the read_* method from Runner::read_tblName()
for each datum I need to retrieve. Now, in a while loop inside
Runner::read_tblName() I could call the mySQLite3::read_* for the data to be
retrieved, but instead of reading the next row of data, it keeps on reading
the same row again and again. Furthermore, I have no way to let
Runner::read_tblName 'know' that there is no more data, hence stopping the
while loop.
Obviously my problem is in design, but I don't have enough experience using
SQLite3 to come up with a better idea.
My question is, really, how do you, C++ programmers, have resolved this
issue? There must be a solution.
void Runner::read_tblName() {
   .
sql_statement = SELECT * FROM name; //while(there is more data){ // I
have no-way to report to this method that there is no more data in the bank
// I could add a flag to the mySQLite3 class and have the while loop check
on its status, // or a signal that would be trigger by the ending of the
while loop.

db-setStmt(sql_statement);
int pos = 0;
data1 = db-read_int(pos);

db-setStmt(sql_statement);
pos = 1;
data2 = db-read_str(pos);
data3 = db-read_str(++pos);
data4 = db-read_str(++pos);
data5 = db-read_str(++pos);

Glib::ustring str;
str = apstr.format(data1);
str +=  ;
str += data2;
str += . ;
str += data3;
str +=  ;
str += data4;
str +=  ;
str += data5;
apex-setException(str, FILE, METHOD, LINE);
apex-Display();
// } ---

}
const int mySQLite3::read_int(int pos)
throw(somexception) {
rc = sqlite3_prepare_v2(db, SQLStatement.c_str(), -1, mystmt, NULL);
if(rc != SQLITE_OK) {
try {
this-display(rc, FILE, METHOD, LINE);
} catch(somexception e) {
throw e;
}
} else {
counter++;
}
rc = sqlite3_step(mystmt);
if(rc == SQLITE_ROW ) {
apint = sqlite3_column_int(mystmt,pos);
}

try {
this-finalize();
} catch(somexception e) {
throw e;
}
return apint;
}
const Glib::ustring mySQLite3::read_str(const int pos)
throw(somexception) {

 //if(pos == 0) {
rc = sqlite3_prepare_v2(db, this-SQLStatement.c_str(), -1, mystmt,
NULL);
 //}
if(rc != SQLITE_OK) {
try {
this-display(rc, FILE, METHOD, LINE);
} catch(somexception e) {
throw e;
}
} else {
counter++;
}

rc = sqlite3_step(mystmt);

if(rc == SQLITE_ROW ) {
apstr = (const char*)sqlite3_column_text(mystmt,pos);
}
try {
this-finalize();
} catch(somexception e) {
throw e;
}
return apstr;

}

___
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] C++ - HOW MANY rows?

2012-09-11 Thread Arbol One
I read my newly created database using this method:

void Runner::read_tblName() {

   .

sql_statement = SELECT * FROM name;

db-setStmt(sql_statement);

int pos = 0;

data1 = db-read_int(pos);

 

db-setStmt(sql_statement);

pos = 1;

data2 = db-read_str(pos);

data3 = db-read_str(++pos);

data4 = db-read_str(++pos);

data5 = db-read_str(++pos);

 

Glib::ustring str;

str = apstr.format(data1);

str +=  ;

str += data2;

str += . ;

str += data3;

str +=  ;

str += data4;

str +=  ;

str += data5;

apex-setException(str, FILE, METHOD, LINE);

apex-Display();

 

}

const int mySQLite3::read_int(int pos)

throw(somexception) {

rc = sqlite3_prepare_v2(db, SQLStatement.c_str(), -1, mystmt, NULL);

if(rc != SQLITE_OK) {

try {

this-display(rc, FILE, METHOD, LINE);

} catch(somexception e) {

throw e;

}

} else {

counter++;

}

rc = sqlite3_step(mystmt);

if(rc == SQLITE_ROW ) {

apint = sqlite3_column_int(mystmt,pos);

}

 

try {

this-finalize();

} catch(somexception e) {

throw e;

}

return apint;

}

const Glib::ustring mySQLite3::read_str(const int pos)

throw(somexception) {

 

 //if(pos == 0) {

rc = sqlite3_prepare_v2(db, this-SQLStatement.c_str(), -1, mystmt,
NULL);

 //}

if(rc != SQLITE_OK) {

try {

this-display(rc, FILE, METHOD, LINE);

} catch(somexception e) {

throw e;

}

} else {

counter++;

}

 

rc = sqlite3_step(mystmt);

 

if(rc == SQLITE_ROW ) {

apstr = (const char*)sqlite3_column_text(mystmt,pos);

}

try {

this-finalize();

} catch(somexception e) {

throw e;

}

return apstr;

 

}

 

This works just fine, but it only reads the first row, how can I 'tell' my
program HOW MANY rows are there to be read and which row I WANT TO READ?

Is there a function in SQLite3 that would help me do this?

 

... work out your salvation with fear and trembling

 

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


Re: [sqlite] C++ - HOW MANY rows?

2012-09-11 Thread Arbol One
Thanks Igor for your prompt response.
Since the call to the sqlite3_step function is inside the mySQLite3::read_*
class-function/method, I call the read_* method from Runner::read_tblName()
for each datum I need to retrieve. Now, in a while loop inside
Runner::read_tblName() I could call the mySQLite3::read_* for the data to be
retrieved, but instead of reading the next row of data, it keeps on reading
the same row again and again. Furthermore, I have no way to let
Runner::read_tblName 'know' that there is no more data, hence stopping the
while loop.
Obviously my problem is in design, but I don't have enough experience using
SQLite3 to come up with a better idea. 
My question is, really, how do you, C++ programmers, have resolved this
issue? There must be a solution.
void Runner::read_tblName() {
   .
sql_statement = SELECT * FROM name;
//while(there is more data){ 
// I have no-way to report to this method that there is no more data in the
bank
// I could add a flag to the mySQLite3 class and have the while loop check
on its status, 
// or a signal that would be trigger by the ending of the while loop. 

db-setStmt(sql_statement);
int pos = 0;
data1 = db-read_int(pos);

db-setStmt(sql_statement);
pos = 1;
data2 = db-read_str(pos);
data3 = db-read_str(++pos);
data4 = db-read_str(++pos);
data5 = db-read_str(++pos);

Glib::ustring str;
str = apstr.format(data1);
str +=  ;
str += data2;
str += . ;
str += data3;
str +=  ;
str += data4;
str +=  ;
str += data5;
apex-setException(str, FILE, METHOD, LINE);
apex-Display();
// } --- 

}
const int mySQLite3::read_int(int pos)
throw(somexception) {
rc = sqlite3_prepare_v2(db, SQLStatement.c_str(), -1, mystmt, NULL);
if(rc != SQLITE_OK) {
try {
this-display(rc, FILE, METHOD, LINE);
} catch(somexception e) {
throw e;
}
} else {
counter++;
}
rc = sqlite3_step(mystmt);
if(rc == SQLITE_ROW ) {
apint = sqlite3_column_int(mystmt,pos);
}

try {
this-finalize();
} catch(somexception e) {
throw e;
}
return apint;
}
const Glib::ustring mySQLite3::read_str(const int pos)
throw(somexception) {

 //if(pos == 0) {
rc = sqlite3_prepare_v2(db, this-SQLStatement.c_str(), -1, mystmt,
NULL);
 //}
if(rc != SQLITE_OK) {
try {
this-display(rc, FILE, METHOD, LINE);
} catch(somexception e) {
throw e;
}
} else {
counter++;
}

rc = sqlite3_step(mystmt);

if(rc == SQLITE_ROW ) {
apstr = (const char*)sqlite3_column_text(mystmt,pos);
}
try {
this-finalize();
} catch(somexception e) {
throw e;
}
return apstr;

}

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


[sqlite] C++ - WHERE clause - 2nd update

2012-09-07 Thread Arbol One
I got this code to work, however, I am getting a segmentation fault on this
code. 

I pass to SQLite only one statement [db-setStmt(apstr);], I read the first
of the 'fname', but I don't know how to get to the second 'fname' in the
database.
I am not very sure as to what do to tell the program to read the next row
until there are no more [ read_str until SQLITE_DONE ] rows to read.
Help?

Glib::ustring apstr;
Glib::ustring sName;
int apint;
mySQLite3* db; 
try {
db = new mySQLite3(db_name.c_str());
} catch(somexception e) {
//do something
}

// SQL statement
Glib::ustring sName;
apstr = SELECT fname FROM ;
apstr += this-db_table_name;
apstr +=  WHERE title = \';
apstr += token;
apstr += \' ;

apint = 0;
db-setStmt(apstr);
do{
try {
sName = db-read_str(apint);
} catch(jme::Exception e ) {
e.Display();
}
apex.setException(sName, FILE, METHOD, LINE);
apex.Display();
}while(sName != finished);



const Glib::ustring mySQLite3::read_str(const int pos)
throw(somexception) {

rc = sqlite3_prepare_v2(db, this-SQLStatement.c_str(), -1, mystmt,
NULL);
if(rc != SQLITE_OK) { 
// do something
}
rc = sqlite3_step(mystmt);
if(rc == SQLITE_ROW ) {
apstr = (const char*)sqlite3_column_text(mystmt,pos);
}else{
apstr = finished; // a small modification
}
try {
this-finalize();
} catch(somexception e) {
throw e;
}
return apstr;
}

What am I doing wrong?

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


Re: [sqlite] C++ - WHERE clause - 2nd update

2012-09-07 Thread Arbol One
Yes, thank?
I gave you the answer you gave me, obviously I was right. 
I need you to prove me right again, how about, haaa yes! if 2x2 is 4,
what is 2x2? Come on! I know you can get it, just try going slowly this
time.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Marcus Grimm
Sent: Friday, September 07, 2012 3:39 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ - WHERE clause - 2nd update


On 07.09.2012 08:58, Arbol One wrote:
 I got this code to work, however, I am getting a segmentation fault on 
 this code.

 I pass to SQLite only one statement [db-setStmt(apstr);], I read the 
 first of the 'fname', but I don't know how to get to the second 
 'fname' in the database.
 I am not very sure as to what do to tell the program to read the next 
 row until there are no more [ read_str until SQLITE_DONE ] rows to read.

well.. you already answered your question:
You step thru the result list until you reach SQLITE_DONE.

In your example you re prepare the statement all the time and thus you will
always get the first hit in your data.
The sequence should be:

sqlite3_prepare_v2

while( sqlite3_step(mystmt) == SQLITE_ROW ) {
/** read the data .. **/
}

sqlite3_finalize
...


 Help?

  Glib::ustring apstr;
  Glib::ustring sName;
  int apint;
  mySQLite3* db;
  try {
  db = new mySQLite3(db_name.c_str());
  } catch(somexception  e) {
  //do something
  }

  // SQL statement
  Glib::ustring sName;
  apstr = SELECT fname FROM ;
  apstr += this-db_table_name;
  apstr +=  WHERE title = \';
  apstr += token;
  apstr += \' ;

  apint = 0;
  db-setStmt(apstr);
  do{
  try {
  sName = db-read_str(apint);
  } catch(jme::Exception  e ) {
  e.Display();
  }
  apex.setException(sName, FILE, METHOD, LINE);
  apex.Display();
  }while(sName != finished);


 
 const Glib::ustring  mySQLite3::read_str(const int pos)
 throw(somexception) {

  rc = sqlite3_prepare_v2(db, this-SQLStatement.c_str(), 
 -1,mystmt, NULL);
  if(rc != SQLITE_OK) {
  // do something
  }
  rc = sqlite3_step(mystmt);
  if(rc == SQLITE_ROW ) {
  apstr = (const char*)sqlite3_column_text(mystmt,pos);
  }else{
  apstr = finished; // a small modification
  }
  try {
  this-finalize();
  } catch(somexception  e) {
  throw e;
  }
  return apstr;
 }

 What am I doing wrong?

 ___
 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] C++ - WHERE clause

2012-09-06 Thread Arbol One
As many of you know, I am trying to learn SQL using C++.

Below is an error I get when I try using the C++ example below it.

 

Error Code: 1

Error Message: near VALUES: syntax error



 

Glib::ustring apstr;

Glib::ustring sName;

int apint;

mySQLite3* db; 

try {

db = new mySQLite3(db_name.c_str());

} catch(somexception e) {

//do something

}

 

   // SQL statement

apstr = SELECT fname FROM ;

apstr += this-db_table_name;

apstr +=  WHERE title = ;

apstr += token;

apstr +=  (n_id, title, fname, mname, lname) VALUES (?, ?, ?, ?, ?);
// here is where the problem is see the method below 

apint = 1;

db-setStmt(apstr);

sName = db-read_str(apint); 

 



const Glib::ustring mySQLite3::read_str(const int pos)

throw(jme::Exception) {

 

rc = sqlite3_prepare_v2(db, this-SQLStatement.c_str(), -1, mystmt,
NULL);

if(rc != SQLITE_OK) { 

// do something

}

rc = sqlite3_step(mystmt);

if(rc == SQLITE_ROW ) {

apstr = (const char*)sqlite3_column_text(mystmt,pos);

}

try {

this-finalize();

} catch(somexception e) {

throw e;

}

return apstr;

}

What am I doing wrong?

 

 

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


[sqlite] C++ - WHERE clause - update

2012-09-06 Thread Arbol One
rc = sqlite3_step(mystmt);
if(rc == SQLITE_ROW ) {
The code, in this case, does not process this statement!!?? --
apstr = (const char*)sqlite3_column_text(mystmt,pos);
std::cout  apstr  std::endl;  //-- this is not executed 
}
Table:
id | tile | fname | mname | lname |
--- 


void ClassforSQLite3::getList(
const Glib::ustring db_name, // Database name
const Glib::ustring token) // Key word to search in the database
throw(jme::Exception) {
Glib::ustring apstr;
Glib::ustring sName;
int apint;
mySQLite3* db; 
try {
db = new mySQLite3(db_name.c_str());
} catch(somexception e) {
...
}

   // SQL statement
apstr = SELECT fname FROM ;
apstr += this-db_table_name;
apstr +=  WHERE title = \';
apstr += token;
apstr += \' ;
apint = 1;
db-setStmt(apstr);
sName = db-read_str(apint); // here is where the problem is see the method 
below



const Glib::ustring mySQLite3::read_str(const int pos)
throw(jme::Exception) {

rc = sqlite3_prepare_v2(db, this-SQLStatement.c_str(), -1, mystmt, NULL);
if(rc != SQLITE_OK) { 
// do something
}
rc = sqlite3_step(mystmt);
if(rc == SQLITE_ROW ) {
// The code, in this case, does not process this statement!!?? --
apstr = (const char*)sqlite3_column_text(mystmt,pos);
}
try {
this-finalize();
} catch(somexception e) {
throw e;
}
return apstr;
}

What am I doing wrong?

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


Re: [sqlite] C++ - WHERE clause - update

2012-09-06 Thread Arbol One
Is this a tricky question?
int sqlite3_step(sqlite3_stmt*);

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Richardson
Sent: Thursday, September 06, 2012 12:21 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ - WHERE clause - update

What is the value returned from sqlite3_step()?

RobR

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Arbol One
Sent: Thursday, September 06, 2012 12:14 PM
To: 'General Discussion of SQLite Database'
Subject: [sqlite] C++ - WHERE clause - update

rc = sqlite3_step(mystmt);
if(rc == SQLITE_ROW ) {
The code, in this case, does not process this statement!!?? --
apstr = (const char*)sqlite3_column_text(mystmt,pos);
std::cout  apstr  std::endl;  //-- this is not executed }
Table:
id | tile | fname | mname | lname |
---
___
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] (no subject)

2012-09-05 Thread Arbol One
Does anyone know if there is a mailing list for the STL project?

 

This e-mail is for the sole use of the intended recipient and may contain
confidential or privileged information. Unauthorized use of its contents is
prohibited. If you have received this e-mail in error, please notify sender
immediately via return e-mail and then delete the original e-mail.

 

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


Re: [sqlite] SQLite support on windows

2012-08-26 Thread Arbol One
[Quote]
*There are a number of devices that run Windows CE

That is the vortex in this issue.

The app is being developed on Win7. Using C++ and Gtkmm as the GUI toolkit,
the libraries used for manipulation and storage of data is 'home cooked',
with the exception of the SQLite3 library. From the inception of the
project, the development has always been with the intention of portability,
thus, it is assumed that if the device can run C/C++ applications it will be
able to run our application as well.

Going back to the question of the 'number of devices' that you mentioned...
where could I find a list of these number of devices? Does Microsoft has
one?

TIA

-Original Message-
From: Mohit Sindhwani [mailto:m...@onghu.com] 
Sent: Sunday, August 26, 2012 1:13 AM
To: General Discussion of SQLite Database
Cc: Arbol One
Subject: Re: [sqlite] SQLite support on windows

On 26/8/2012 12:30 PM, Arbol One wrote:
 I am glad someone asked this question, we are almost finish with a 
 small application that is best suited for a hand held device. Is there 
 a device anyone here could suggest?
 As I said, the application is very small and uses SQLite as its RDB. 
 The application resembles a questionnaire... fill in the blanks kind 
 of thing, the data collected goes in to the RDB and later on downloaded to
a pc.

 TIA

What kind of device are you looking for?  A lot also depends on what
platform your application is built for, and what it needs.  Your current
description tends to suggest that it's rather well suited as an app for any
(or many) of the mobile phones.  There are a number of devices that run
Windows CE and you can compile SQLite3 with Visual Studio for those devices.

Best Regards,
Mohit.
26/8/2012 | 1:11 PM.

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


Re: [sqlite] SQLite support on windows

2012-08-25 Thread Arbol One
I am glad someone asked this question, we are almost finish with a small
application that is best suited for a hand held device. Is there a device
anyone here could suggest?
As I said, the application is very small and uses SQLite as its RDB. The
application resembles a questionnaire... fill in the blanks kind of thing,
the data collected goes in to the RDB and later on downloaded to a pc.

TIA

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Mohit Sindhwani
Sent: Saturday, August 25, 2012 6:26 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] SQLite support on windows

On 22/8/2012 11:49 PM, Rajahariharan Jayam wrote:
 Dear,



 What are the windows O/S version does the SQLite supports?


As far as I know, it should support any version of Windows that you can
compile it for... I don't remember seeing any posts in the past that support
for any specific version of Windows has been dropped. So, it probably goes
back enough to still support Windows 98 or so. It does work fine on recent
Windows versions (I have used it on Windows XP, Windows 2000, Windows Server
2003/ 2008, and Windows Vista/7).

SQlite3 works fine on Windows CE (at least 5.0 and 6.0) and Windows Mobile
6.x or so.  Windows Phone 7 doesn't support end-users compiling native C/
C++ code and accessing it from their applications - but there is a C# port
that does work (as far as I know).

That said, I think there is a build in the works for WinRT - I'm not sure of
the status of that.  Other than that, Windows 8 and Windows Phone 8 support
native C/ C++ code and there's no reason why it should not work.

Now, the real question is - what is the set of version(s) that you are keen
to check support for.. as you can see, your question is quite vague.

Best Regards,
Mohit.
25/8/2012 | 6:24 PM.


___
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] C++ - Installer

2012-08-02 Thread Arbol One
I was wondering if there is an 'Installer' for Windows 7 that you would
recommend. I want my user to have all the necessary SQLite3 files needed for
my application as well as all the gtkmm files.

 

TIA

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


[sqlite] C++ - Finalizing my SQLite interface

2012-07-27 Thread Arbol One
Before calling the destructor, I would like to make sure that all the
sqlite3_stmt have been 'finalized', is there a function in SQLite that that
can help me do this, or should I just use 'NULL'?

 

tia

 

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


[sqlite] C++ - Evaluating a statement

2012-07-26 Thread Arbol One
Reading the documentation, it says that 'sqlite3_step(sqlite3_stmt*)

' must be called at least once to evaluate the statement. However, what does
it evaluate?

 

 

Freedom of speech does not translate to freedom of insulting

 

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


[sqlite] C++ - All the data in ONE row

2012-07-25 Thread Arbol One
OK, continuing with the writing to the database, here is the driver method
for the class rapper for SQLite3. 

The problem I have is that I have no control as to the exact location where
I want the data to be stored, look the table below to have a better idea of
what I mean.

 

My question is, is there a function that will allow me to directly plug the
data at that specific index I want?

Ultimately, what I want to do is to store all the data in ONE row. How is
this handle in SQLite3?

 

TIA

 

void someClass::write2tblName() {

stmtName = INSERT INTO name (n_id, title, fname, mname, lname) VALUES
(?, ?, ?, ?, ?);

int data1 = 1;

Glib::ustring data2, data3, data4, data5;

data2 = Mr;

data3 = Dennis;

data4 = Father Of C And UNIX;

data5 = Ritchie;

int pos = 1;

try {

db-write(stmtName,pos, data1);

db-write(stmtName,pos, data2);

db-write(stmtName,pos,data3);

db-write(stmtName,pos,data4);

db-write(stmtName,pos,data5);

   }catch(someException){.}

}

void mySQLite3Class::write(const Glib::ustring sql_stmt, int pos,  int data
)

throw(someException) {

rc = sqlite3_prepare_v2(db, sql_stmt.c_str(), -1, stmt, NULL);

if(rc != SQLITE_OK) { throw(someException)}

rc = sqlite3_bind_int(stmt, pos, data);

if(rc != SQLITE_OK) { throw(someException)   }

rc = sqlite3_step(stmt);

if(rc != SQLITE_DONE) { throw(someException)   }

sqlite3_finalize(stmt);

 

}

void mySQLite3Class::write(const Glib::ustring sql_stmt,int pos,

   const Glib::ustring data )

throw(someException) {

rc = sqlite3_prepare_v2(db, sql_stmt.c_str(), -1, stmt, NULL);

if(rc != SQLITE_OK) { throw(someException)}

 

rc = sqlite3_bind_text(stmt, pos, data.c_str(),data.length(),
SQLITE_STATIC);

if(rc != SQLITE_OK) { throw(someException)   }

rc = sqlite3_step(stmt);

if(rc != SQLITE_DONE) { throw(someException)   }

sqlite3_finalize(stmt);

}

==

n_id | title | fname | mname | lname |

==

1|   |   |   |   |

2|Mr |   |   |   |

3|   |Denis  |   |   |

4|   |   |Fath.. |   |

5|   |   |   |Ritchie|

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


[sqlite] C++ - sqlite3_extended_result_codes(

2012-07-24 Thread Arbol One
I would like to turn on the extended result codes, however, the prototype
below does not explain what the value for the second parameter should be.

Can anybody help?

int sqlite3_extended_result_codes(sqlite3*, int onoff);

 

TIA

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


Re: [sqlite] C++ - sqlite3_extended_result_codes(

2012-07-24 Thread Arbol One
Thanks everyone, I just wanted to be sure.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp
Sent: Tuesday, July 24, 2012 4:16 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ - sqlite3_extended_result_codes(

On Tue, Jul 24, 2012 at 4:13 PM, Arbol One arbol...@gmail.com wrote:

 I would like to turn on the extended result codes, however, the 
 prototype below does not explain what the value for the second parameter
should be.

 Can anybody help?

 int sqlite3_extended_result_codes(sqlite3*, int onoff);




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


[sqlite] C++ - nothing has been stored!!??

2012-07-24 Thread Arbol One
And here I am again, asking for what you find so easy and I. well, just
cannot understand.

I am trying to write to a database table previously created by another
process like this:

void someClass::create_tblName() {

sql_param_tblName = CREATE TABLE name(n_id INTEGER PRIMARY KEY, title
TEXT, fname TEXT, mname TEXT, lname TEXT);

try {db-createTable(sql_param_tblName); } catch(someException e) {...}

}

void mySQLite3Class::createTable(const Glib::ustring s) throw
(someException) {

rc = sqlite3_prepare_v2( db, s.c_str(), -1, stmt, NULL);

if(rc != SQLITE_OK ) { throw someException }

rc = sqlite3_step(stmt);

if(rc != SQLITE_DONE) { throw someException }

}

}

 

The actual writing to the table looks like this:

 

void someClass::write2tblName() {

stmtName = INSERT INTO name (n_id, title, fname, mname, lname) VALUES
(?, ?, ?, ?, ?);

int data1 = 10;

int pos = 1;

try{db-write(stmtName,pos, data1);}catch(someException){.}

}

void mySQLite3Class::write(const Glib::ustring sql_stmt, int pos,  int data
)throw(someException) {

rc = sqlite3_prepare_v2(db, sql_stmt.c_str(), -1, stmt, NULL);

if(rc != SQLITE_OK) { throw(someException)}

rc = sqlite3_bind_int(stmt, pos, data);

if(rc != SQLITE_OK) { throw(someException)   }

 

}

 

but this does not store anything in the database table. I have used an
sqlite browser to determine if, in fact, some data was stored, but no,
nothing has been stored.

What am I doing wrong?

 

 

Leonardo da Vinci:
I have offended God and mankind because my work did not reach the quality
it should have

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


[sqlite] A matter of UNIQUEness

2012-07-23 Thread Arbol One
When using the statement 'UNIQUE INTEGER val',  does SQLite3 automatically
create a unique integer value for the transaction  or would it only
ascertain the uniqueness within that column?

 

i.e.:

Glib::ustring sql_param_tblName = CREATE TABLE name(n_id INTEGER PRIMARY
KEY, title TEXT, fname TEXT, mname TEXT, lname TEXT);

[I understand that UNIQUE  is implied in PRIMARY KEY?]

 

Freedom of speech does not translate to freedom of insulting

 

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


[sqlite] C++ - Creating Table

2012-07-23 Thread Arbol One
Using SQLite version 3.7.8 amalgamation, under Win7 with MinGW, I compile
the bellow program, but for some strange reason I am getting a runtime error
when creating the table. I hope that one of you would be able to tell me
what I am doing wrong.

 

TIA

===

class mySQLite3Class {

private:

//SQLite3

sqlite3* db; //SQLite3

Glib::ustring dbName; // Database name

Glib::ustring apstr; // All Purpose String

 

Glib::ustring sql_param_tblName; // Databese table Name parameters

Glib::ustring stmtName;  // SQL statement name

public:

void createDB();

void create_tblName();

mySQLite3Class(const Glib::ustring s){ createDatabase(s);}

};

void mySQLite3Class::createDatabase(const Glib::ustring s) {

rc = sqlite3_open_v2(s.c_str(),

 db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,

 NULL);

if(rc != SQLITE_OK) {

std::cout  rc  std::endl;

}

}

void mySQLite3Class::createTable(const Glib::ustring s){

 rc = sqlite3_prepare_v2(db, s.c_str(), s.length(), stmt, NULL );

if(rc != SQLITE_OK) {

   std::cout  rc  std::endl;// error = 1

   std::cout  sqlite3_errmsg(db) 

std::endl; // er-msg = library routine called out
of sequence

}

rc = sqlite3_step(stmt);

if(rc != SQLITE_DONE) {

std::cout  rc  stdl;

}

sqlite3_finalize(stmt);

}

myClass{

private:

mySQLite3Class* myDB;

Glib::ustring sql_param_tblName;

Glib::ustring dbName;

public:

myClass();

}

myClass::myClass(){

dbName = 001Database.sql;

sql_param_tblName = CREATE TABLE name(n_id INTEGER PRIMARY KEY, title
TEXT, fname TEXT, mname TEXT, lname TEXT);

myDB = new mySQLite3Class(dbName);

myDB-createTable(sql_param_tblName); == // problem

}

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


Re: [sqlite] C++ - Creating Table

2012-07-23 Thread Arbol One
 = 001Database.sql;
  string sql_param_tblName = CREATE TABLE name(n_id INTEGER PRIMARY KEY,
title TEXT, fname TEXT, mname TEXT, lname TEXT);
  mySQLite3Class *myDB = new mySQLite3Class(dbName);
  myDB-createTable(sql_param_tblName);
  return 0;
}


Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Advanced GEOINT Solutions Operating Unit Northrop Grumman Information
Systems




From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on
behalf of Arbol One [arbol...@gmail.com]
Sent: Monday, July 23, 2012 1:54 PM
To: SqLite
Subject: EXT :[sqlite] C++ - Creating Table


Using SQLite version 3.7.8 amalgamation, under Win7 with MinGW, I compile
the bellow program, but for some strange reason I am getting a runtime error
when creating the table. I hope that one of you would be able to tell me
what I am doing wrong.



TIA

===

class mySQLite3Class {

private:

//SQLite3

sqlite3* db; //SQLite3

Glib::ustring dbName; // Database name

Glib::ustring apstr; // All Purpose String



Glib::ustring sql_param_tblName; // Databese table Name parameters

Glib::ustring stmtName;  // SQL statement name

public:

void createDB();

void create_tblName();

mySQLite3Class(const Glib::ustring s){ createDatabase(s);}

};

void mySQLite3Class::createDatabase(const Glib::ustring s) {

rc = sqlite3_open_v2(s.c_str(),

 db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,

 NULL);

if(rc != SQLITE_OK) {

std::cout  rc  std::endl;

}

}

void mySQLite3Class::createTable(const Glib::ustring s){

 rc = sqlite3_prepare_v2(db, s.c_str(), s.length(), stmt, NULL );

if(rc != SQLITE_OK) {

   std::cout  rc  std::endl;// error = 1

   std::cout  sqlite3_errmsg(db)

std::endl; // er-msg = library routine called out
of sequence

}

rc = sqlite3_step(stmt);

if(rc != SQLITE_DONE) {

std::cout  rc  stdl;

}

sqlite3_finalize(stmt);

}

myClass{

private:

mySQLite3Class* myDB;

Glib::ustring sql_param_tblName;

Glib::ustring dbName;

public:

myClass();

}

myClass::myClass(){

dbName = 001Database.sql;

sql_param_tblName = CREATE TABLE name(n_id INTEGER PRIMARY KEY, title
TEXT, fname TEXT, mname TEXT, lname TEXT);

myDB = new mySQLite3Class(dbName);

myDB-createTable(sql_param_tblName); == // problem

}

___
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] sql statement CREATE TABLE

2012-07-22 Thread Arbol One
I am getting a run time error that reads

=

Error 1

Library routine out of sequence

=

 

The only things, since I am new on it, that could be causing a problem would
be the sql statement CREATE TABLE, maybe the parameters are not right?

 

The code nip -

 

sql_param_tblName = CREATE TABLE name(n_id INTEGER PRIMARY KEY, title TEXT,
fname TEXT, mname TEXT, lname TEXT);

rc = sqlite3_prepare_v2(  db,  sql_param_tblName.c_str() ,
sql_param_tblName.length(),  stmt,   NULL);

if(rc != SQLITE_OK) {

   /// Here is where the -Error 1- occurred 

 }

rc = sqlite3_step(stmt);

 

if(rc != SQLITE_DONE) {

sqlite3_close(db);

sqlite3_finalize(stmt);

//Error

}

sqlite3_finalize(stmt);

}Freedom of speech does not translate to freedom of insulting

 

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


[sqlite] Many tables in one database

2012-07-20 Thread Arbol One
Using SQLite3.7.8 amalgamation and C++, I would like to create a database
with several joined tables. Can SQLite3 have many tables in one database?

 

Freedom of speech does not translate to freedom of insulting

 

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


[sqlite] database AND table already exist?

2012-07-20 Thread Arbol One
Is there a way to find out if a certain database AND table already exist?

In my C++ program I would like to query SQLite3 to find out if a database
already exists and also if a particular table exists in that database. Is
there a way to do this?

I am using std i/o methods to check for the existing SQLite3 file containing
the database, but I don't have a way to find out if the table in question
does in fact exist.

 

TIA  

 

Freedom of speech does not translate to freedom of insulting

 

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


Re: [sqlite] C++ programming - creating a table

2012-06-25 Thread Arbol One
Q: What are you trying to achieve here? What's the supposed purpose of
sqlite3_column_type call?

A: What I am trying to do is to display the data in a data table, but the
statement

std::cout  (char*)sqlite3_column_text(stmt, 0)  std::endl;

produces a segmentation error.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: Monday, June 25, 2012 12:07 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ programming - creating a table

Arbol One arbol...@gmail.com wrote:
create_table = CREATE TABLE friend (name TEXT, address TEXT, age
INT);
 
std::cout  sqlite3_column_type(stmt,0)  std::endl;

sqlite_column_* functions are only meaningful for queries that produce a
resultset - namely, SELECT and certain PRAGMAs. None of the data definition
statements (of which CREATE TABLE is one), nor INSERT, UPDATE or DELETE
statements, produce a resultset; thus, sqlite3_column_* functions couldn't
be used with them.

What are you trying to achieve here? What's the supposed purpose of
sqlite3_column_type call?
-- 
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] C++ programming - Extracting data

2012-06-25 Thread Arbol One
Sorry, I forgot to give you a snip of the test-bench code

getter() {
string sName;
string sAddress;
int age = 0;
string dbdata = SELECT * FROM friend;

rc = sqlite3_prepare_v2(db, dbdata.c_str(), -1, stmt, NULL );

rc = sqlite3_step(stmt);
if(rc != SQLITE_DONE) { ... }
while ( sqlite3_step(stmt) != SQLITE_ROW)  {
sName = (char*)sqlite3_column_text(stmt, 0); //== Seg fault
std::cout  sName  std::endl;
...
}
sqlite3_finalize(stmt);
}



-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: Monday, June 25, 2012 9:07 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ programming - creating a table

Arbol One arbol...@gmail.com wrote:
 Q: What are you trying to achieve here? What's the supposed purpose of 
 sqlite3_column_type call?
 
 A: What I am trying to do is to display the data in a data table

You run a SELECT statement for that. In any case, what data do you expect
there to be right after CREATE TABLE?
--
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] C++ programming - Extracting data

2012-06-25 Thread Arbol One
I did what you suggested, you were right, now the exception is gone, but the
program now does not display anything, it just goes to the end of the
method.
Here is a more complete snip of the test bench program. I really hope that
someone here can help resolve this issue.

// TEST BENCH
// 1. Create/Open a database 'db'
// 2. Add a table in the database 'friend'
// 3. add data to table friend
// 4. Extract the data from table friend and display it

OpenDB() {
rc = sqlite3_open_v2(dbName.c_str(),
 db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
 NULL);
if(rc != SQLITE_OK) { /* display error msg */ }

}
CreateTable() {
create_table = CREATE TABLE friend (name TEXT, address TEXT, age INT);

rc = sqlite3_prepare_v2( db, create_table.c_str(), -1, stmt, NULL );
if(rc != SQLITE_OK) { /* display error msg */ }

rc = sqlite3_step(stmt);
if(rc != SQLITE_DONE) { /* display error msg */ }
sqlite3_finalize(stmt);
}
Setter() {
string Name;
string dbdata = INSERT INTO friend (name, address, age) VALUES
('Caramba', '490 New Bridge', '49');
rc = sqlite3_prepare_v2(db, bdata.c_str(),dbdata.length(),stmt,NULL);
if(rc != SQLITE_OK) { /* display error msg */ }
.
rc = sqlite3_step(stmt);
if(rc != SQLITE_DONE) { /* display error msg */}

sqlite3_finalize(stmt);
}
getter() {
string sName;
string dbdata = SELECT * FROM friend;

rc = sqlite3_prepare_v2(db, dbdata.c_str(), -1, stmt, NULL );
if(rc != SQLITE_OK) { /* display error msg */ }

rc = sqlite3_step(stmt);
if(rc != (SQLITE_DONE)  rc != (SQLITE_ROW)){ ... }
while (sqlite3_step(stmt) == SQLITE_ROW) {
sName = (char*)sqlite3_column_text(stmt, 0);
obj.Display(sName); //== this is not display
...
}
sqlite3_finalize(stmt);
}
theDestructor() {
sqlite3_close(db);
}


-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS)
Sent: Monday, June 25, 2012 9:39 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ programming - Extracting data

You're not doing the right sequencing...so your cout is only executing when
there is NOT a row.



Change

rc = sqlite3_step(stmt);
if(rc != SQLITE_DONE) { ... }
while ( sqlite3_step(stmt) != SQLITE_ROW)  {
sName = (char*)sqlite3_column_text(stmt, 0); //== Seg fault
std::cout  sName  std::endl;
...
}

To

while ( sqlite3_step(stmt) == SQLITE_ROW)  {
sName = (char*)sqlite3_column_text(stmt, 0); //== Seg fault
std::cout  sName  std::endl;
...
}



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on
behalf of Arbol One [arbol...@gmail.com]
Sent: Monday, June 25, 2012 8:27 AM
To: 'General Discussion of SQLite Database'
Subject: EXT :Re: [sqlite] C++ programming - Extracting data

Sorry, I forgot to give you a snip of the test-bench code

getter() {
string sName;
string sAddress;
int age = 0;
string dbdata = SELECT * FROM friend;

rc = sqlite3_prepare_v2(db, dbdata.c_str(), -1, stmt, NULL );

rc = sqlite3_step(stmt);
if(rc != SQLITE_DONE) { ... }
while ( sqlite3_step(stmt) != SQLITE_ROW)  {
sName = (char*)sqlite3_column_text(stmt, 0); //== Seg fault
std::cout  sName  std::endl;
...
}
sqlite3_finalize(stmt);
}



-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: Monday, June 25, 2012 9:07 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ programming - creating a table

Arbol One arbol...@gmail.com wrote:
 Q: What are you trying to achieve here? What's the supposed purpose of 
 sqlite3_column_type call?

 A: What I am trying to do is to display the data in a data table

You run a SELECT statement for that. In any case, what data do you expect
there to be right after CREATE TABLE?
--
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
___
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] C++ programming - Extracting data

2012-06-25 Thread Arbol One
Yes, yes!!
thank you, now I understand!!
Superb!
Thanks Michael!

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS)
Sent: Monday, June 25, 2012 11:03 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ programming - Extracting data

You were doing two sqlite3_step()'s instead of one.  So you skipped the one
record you had inserted.

You can run this multiple times and you;; see error messages about the
create table on 2nd and subsequent runs.

Still adds the same record though so you'll see +1 records get printed out
for every time you run it.



Here's a complete working example:



#include iostream
#include sqlite3.h

using namespace std;

// TEST BENCH
// 1. Create/Open a database 'db'
// 2. Add a table in the database 'friend'
// 3. add data to table friend
// 4. Extract the data from table friend and display it

sqlite3 *db;

void OpenDB() {
  int rc;
  string dbName = arbol.db;
  rc = sqlite3_open_v2(dbName.c_str(),
   db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
   NULL);
  if(rc != SQLITE_OK) { /* display error msg */
cerr  Error???  endl;
  }
}
void CreateTable() {
  string create_table = CREATE TABLE friend (name TEXT, address TEXT, age
INT);
  sqlite3_stmt *stmt;

  int rc = sqlite3_prepare_v2( db, create_table.c_str(), -1, stmt, NULL );
  if(rc != SQLITE_OK) {
cerr  Error1:   sqlite3_errmsg(db)  endl;
  }

  rc = sqlite3_step(stmt);
  if(rc != SQLITE_DONE) {
cerr  Error2:   sqlite3_errmsg(db)  endl;
  }
  sqlite3_finalize(stmt);
}
void Setter() {
  string Name;
  sqlite3_stmt *stmt;
  string dbdata = INSERT INTO friend (name, address, age) VALUES
('Caramba', '490 New Bridge', '49');
  int rc = sqlite3_prepare_v2(db,
dbdata.c_str(),dbdata.length(),stmt,NULL);
  if(rc != SQLITE_OK) {
cerr  Error:   sqlite3_errmsg(db)  endl;
  }
  rc = sqlite3_step(stmt);
  if(rc != SQLITE_DONE) {
cerr  Error:   sqlite3_errmsg(db)  endl;
  }
  sqlite3_finalize(stmt);
}
void getter() {
  string sName;
  string dbdata = SELECT * FROM friend;
  sqlite3_stmt *stmt;

  int rc = sqlite3_prepare_v2(db, dbdata.c_str(), -1, stmt, NULL );
  if(rc != SQLITE_OK) {
cerr  Error:   sqlite3_errmsg(db)  endl;
  }
  while (sqlite3_step(stmt) == SQLITE_ROW) {
sName = (char*)sqlite3_column_text(stmt, 0);
//obj.Display(sName); //== this is not display
cout  sName=  sName  endl;
  }
  sqlite3_finalize(stmt);
}
void theDestructor() {
  int rc=sqlite3_close(db);
  if (rc != SQLITE_OK) {
cerr  Error:   sqlite3_errmsg(db)  endl;
  }
}

int main() {
  OpenDB();
  CreateTable();
  Setter();
  getter();
  theDestructor();
  return 0;
}



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on
behalf of Arbol One [arbol...@gmail.com]
Sent: Monday, June 25, 2012 9:30 AM
To: 'General Discussion of SQLite Database'
Subject: EXT :Re: [sqlite] C++ programming - Extracting data

I did what you suggested, you were right, now the exception is gone, but the
program now does not display anything, it just goes to the end of the
method.
Here is a more complete snip of the test bench program. I really hope that
someone here can help resolve this issue.

// TEST BENCH
// 1. Create/Open a database 'db'
// 2. Add a table in the database 'friend'
// 3. add data to table friend
// 4. Extract the data from table friend and display it

OpenDB() {
rc = sqlite3_open_v2(dbName.c_str(),
 db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
 NULL);
if(rc != SQLITE_OK) { /* display error msg */ }

}
CreateTable() {
create_table = CREATE TABLE friend (name TEXT, address TEXT, age INT);

rc = sqlite3_prepare_v2( db, create_table.c_str(), -1, stmt, NULL );
if(rc != SQLITE_OK) { /* display error msg */ }

rc = sqlite3_step(stmt);
if(rc != SQLITE_DONE) { /* display error msg */ }
sqlite3_finalize(stmt);
}
Setter() {
string Name;
string dbdata = INSERT INTO friend (name, address, age) VALUES
('Caramba', '490 New Bridge', '49');
rc = sqlite3_prepare_v2(db, bdata.c_str(),dbdata.length(),stmt,NULL);
if(rc != SQLITE_OK) { /* display error msg */ }
.
rc = sqlite3_step(stmt);
if(rc != SQLITE_DONE) { /* display error msg */}

sqlite3_finalize(stmt);
}
getter() {
string sName;
string dbdata = SELECT * FROM friend;

rc = sqlite3_prepare_v2(db, dbdata.c_str(), -1, stmt, NULL );
if(rc != SQLITE_OK) { /* display error msg */ }

rc = sqlite3_step(stmt);
if(rc != (SQLITE_DONE)  rc != (SQLITE_ROW)){ ... }
while (sqlite3_step(stmt) == SQLITE_ROW) {
sName = (char*)sqlite3_column_text(stmt, 0);
obj.Display(sName); //== this is not display

[sqlite] C++ - ISERT from a data object

2012-06-25 Thread Arbol One
In my GUI application the user enters a information that will go in a SQLite
database table, so statements like:

string dbdata = INSERT INTO friend (name, address, age) VALUES ('Caramba',
'490 New Bridge', '49');

 

are not very useful in a real life C++ GUI  application. I would assume that
SQLite has functions to submit information in the form of string object  to
a table i.e.:

--snip--

std::string name;

int age;

sqlite3_submit_data_text(db, table, name, ..);

sqlite3_submit_data_int(db, table, age, ..);

 

What is the C++ API for entering data to a table?

 

Thanks!!

 

Freedom of speech does not translate to freedom of insulting

 

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


Re: [sqlite] C++ - ISERT from a data object

2012-06-25 Thread Arbol One
My friend, heavens awaits you.
Outstanding!
Thanks man!

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: Monday, June 25, 2012 7:32 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ - ISERT from a data object

Arbol One arbol...@gmail.com wrote:
 In my GUI application the user enters a information that will go in a 
 SQLite database table, so statements like:
 
 string dbdata = INSERT INTO friend (name, address, age) VALUES 
 ('Caramba',
 '490 New Bridge', '49');
 
 
 
 are not very useful in a real life C++ GUI  application. I would 
 assume that SQLite has functions to submit information in the form of 
 string object  to a table

sqlite_stmt* stmt;
sqlite3_prepare_v2(db, insert into friend(name, address, age) values (?, ?,
?);, -1, stmt, NULL);

string name = Caramba;
string address = 490 New Bridge;
int age = 49;

sqlite3_bind_text(stmt, 1, name.c_str(), name.length(), SQLITE_STATIC);
sqlite3_bind_text(stmt, 2, address.c_str(), address.length(),
SQLITE_STATIC); sqlite3_bind_int(stmt, 3, age);

sqlite3_step(stmt);
sqlite3_finalize(stmt);

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


[sqlite] C++ programming - SELECT question

2012-06-24 Thread Arbol One
 

 

A pessimist is one who makes difficulties of his opportunities and an
optimist is one who makes opportunities of his difficulties.

 

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


[sqlite] C++ programming - getting data from a table

2012-06-24 Thread Arbol One
in a database called 'db' I created a table named 'friend' that looks like
this:

string create_table( CREATE TABLE friend (name TEXT, address TEXT, age
INT));

I entered some values in that table and now I would like to extract the
values from that table. Shown below is what I have done so far, but I have
hit a wall, I cannot find definitive information as to how to view the
extracted data, if any.

What do I do next to view the data from that table?

 

TIA

 snip 

getData(){

string sName;

string sAddress;

int age = 0;

string dbdata = SELECT * FROM friend;



rc = sqlite3_prepare_v2(

 db,  /* Database handle */

 dbdata.c_str() ,   /* SQL statement, UTF-8 encoded */

 dbdata.length(),   /* Maximum length of zSql in bytes. */

 stmt,/* OUT: Statement handle */

 NULL /* OUT: Pointer to unused portion of
zSql */

 );



rc = sqlite3_step(stmt);

?

}

 

A pessimist is one who makes difficulties of his opportunities and an
optimist is one who makes opportunities of his difficulties.

 

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


Re: [sqlite] C++ programming - getting data from a table

2012-06-24 Thread Arbol One
' view the extracted data  '

 

Thank you for the prompt response. Now, using simple std::cout, could you
show (give an example) of how to display (out streaming) the data extracted?

Thanks!

 

 

Note to developers

~~

The C/C++ documentation of SQLite must include small examples.

TIA

 

 

-Original Message-

From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin

Sent: Sunday, June 24, 2012 11:59 AM

To: General Discussion of SQLite Database

Subject: Re: [sqlite] C++ programming - getting data from a table

 

 

On 24 Jun 2012, at 3:40pm, Arbol One arbol...@gmail.com wrote:

 

 I entered some values in that table and now I would like to extract 

 the values from that table. Shown below is what I have done so far, 

 but I have hit a wall, I cannot find definitive information as to how 

 to view the extracted data, if any.

 

 What do I do next to view the data from that table?

 

[Simplified answer for SQLite starter]

 

You're asking about the set of commands which go _prepare(), _step(),
_finalize().  These are commands which create, use and destroy an SQLite
statement.

 

Do one _prepare() which causes SQLite to do complicated things to make a
statement.

Do _step() to get a row, and continue to do them while it continues to give
a result code of SQLITE_ROW Do one _finalize() to tell SQLite you no longer
need that statement's handle, memory, etc..

 

If _step() returns SQLITE_ROW it makes available one row of the resulting
table.  You can read the data from that row using functions like
sqlite3_column_int() and sqlite3_column_text().  You need as many of these
calls as you expect columns returned by your SELECT statement.  You pass
into that function the statement handle, and the number of the column you
want, with column 0 being the first column.

 

Details of the statement loop are here:

 

http://www.sqlite.org/c3ref/stmt.html

 

Details of how to retrieve the values of a row are here:

 

http://www.sqlite.org/c3ref/column_blob.html

 

Hope this helps.

 

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] C++ programming - getting data from a table

2012-06-24 Thread Arbol One
Nice!!
I will try your explanation in my test-bench, but just by looking at it, it
make sense.
Thanks Igor!!

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: Sunday, June 24, 2012 12:55 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ programming - getting data from a table

Arbol One arbol...@gmail.com wrote:
 Thank you for the prompt response. Now, using simple std::cout, could 
 you show (give an example) of how to display (out streaming) the data
extracted?

sqlite3* db;
sqlite3_open(db, db);

sqlite_stmt* stmt;
sqlite3_prepare_v2(db, select name, address, age from friend, -1, stmt,
NULL);

while (sqlite3_step(stmt) == SQLITE_ROW) {
  cout  (char*)sqlite3_column_text(stmt, 0)  ' '  
(char*)sqlite3_column_text(stmt, 1)  ' ' 
sqlite3_column_int(stmt, 2)  endl; }

sqlite3_finalize(stmt);
sqlite3_close(db);

Error handling is left as an exercise for the reader.
--
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] C++ programming - inserting data in a table

2012-06-24 Thread Arbol One
Thanks for the prompt response.
Here is the same problem when using INSERT.
Setter() {
dbdata = INSERT INTO friend VALUES('Caramba', '490 New Bridge', '49');
rc = sqlite3_prepare_v2(
 db,
 dbdata.c_str() ,
 dbdata.length(),
 stmt,
 NULL
 );
.
rc = sqlite3_step(stmt);
if(rc != SQLITE_DONE) {
..
}
/// the output here is 5, meaning SQLITE_NULL. The output should be 3 =
SQLITE3_TEXT
std::cout  sqlite3_column_type(stmt,0);
sqlite3_finalize(stmt);
}

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: Monday, June 25, 2012 12:07 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ programming - creating a table

Arbol One arbol...@gmail.com wrote:
create_table = CREATE TABLE friend (name TEXT, address TEXT, age
INT);
 
std::cout  sqlite3_column_type(stmt,0)  std::endl;

sqlite_column_* functions are only meaningful for queries that produce a
resultset - namely, SELECT and certain PRAGMAs. None of the data definition
statements (of which CREATE TABLE is one), nor INSERT, UPDATE or DELETE
statements, produce a resultset; thus, sqlite3_column_* functions couldn't
be used with them.

What are you trying to achieve here? What's the supposed purpose of
sqlite3_column_type call?
-- 
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] C++ programming - int sqlite3_prepare_v2() question

2012-06-22 Thread Arbol One
Thanks for the prompt response.
 As I stated in my previous email, I used SQLight Designer to view the 
database, which application would you recommend to view my database? Please 
keep in mind that I am not able to purchase a program, so it needs to be a free 
trial or a freeware.
 On the other hand, as far as you can see, should the code I have shown open a 
database, create a table and then add data to the table?

 Thanks!

- Original Message -
From: Pavel Ivanov
Sent: 06/21/12 01:08 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

  Also, I have downloaded and installed 'SQLight Designer' and when opening 
  the database file, I have just created, all that I can see is the words: 
  SQLite format 3. Apparently you open your database file in some plain text 
  editor instead of in something that understands what SQLite database is. 
  Pavel On Thu, Jun 21, 2012 at 12:22 PM, Arbol One arbol...@programmer.net 
  wrote:  namespace jme {  class Runner : public Gtk::Window {  private:  
  jme::Exception* e; // Exception handler  sqlite3 *db; // Data Base  
  sqlite3_stmt* stmt; // SQL statement  Glib::ustring dbName; // db name  
  Glib::ustring sName; // my name  Glib::ustring sAddress; // my address  
  Glib::ustring vfs; // MSWIN Identifier  int rc; // return code  int age; 
  // my age  // SQL statement  Glib::ustring dbdata;  Glib::ustring 
  create_table;  public:  Runner();  ~Runner();  void OpenDB();  void 
  CreateTable();  void AddData();  };  }  void jme::Runner::CreateTable(){ 
   rc = sqlite3_prepare_v2( 
  db, /* Database handle */  create_table.c_str() , /* SQL statement, UTF-8 
encoded */  create_table.length(), /* Maximum length of zSql in bytes. */  
stmt, /* OUT: Statement handle */  NULL /* OUT: Pointer to unused portion of 
zSql */  );  if(rc != SQLITE_OK) {  sqlite3_close(db);  std::cout  error 
prepare_v2:   rc  std::endl;  exit(-2);  }  rc = sqlite3_step(stmt);  
if(rc != SQLITE_DONE) {  sqlite3_close(db);  std::cout  error 
sqlite3_step:   rc  std::endl;  exit(-3);  }  sqlite3_finalize(stmt);  
}  void jme::Runner::AddData(){  rc = sqlite3_prepare_v2(  db, /* Database 
handle */  dbdata.c_str() , /* SQL statement, UTF-8 encoded */  
dbdata.length(), /* Maximum length of zSql in bytes. */  stmt, /* OUT: 
Statement handle */  NULL /* OUT: Pointer to unused portion of zSql */  );  
if(rc != SQLITE_OK) {    }  rc = sqlite3_step(stmt);  if(rc != 
SQLITE_DONE) {    }  sqlite3_finalize(stmt);  }  void 
jme::Runner::OpenDB()
  {  rc = sqlite3_open_v2(dbName.c_str(),  db, SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE,  NULL);  if(rc != SQLITE_OK) {    }  
jme::Runner::Runner() {  dbName = sqliteTest.sql;  sName = ArbolOne;  
sAddress = 1 Parkway Rd;  vfs = win32;  age = 22;  dbdata = INSERT INTO 
friend VALUES('Jamiil', '49 New Bridge', '49');  create_table = CREATE TABLE 
friend (name TEXT, address TEXT, age INT);  try {  jme::gnu_io f;  
f.deleteFile(dbName);  } catch(jme::Exception e) {  std::cout  e.what()  
std::endl;  }  OpenDB();  CreateTable();  AddData();   }  
jme::Runner::~Runner(){  sqlite3_close(db);  cout  Good bye!  endl;  } 
 int main(int argc, char *argv[]) {  try {  Gtk::Main kit(argc, argv);  
jme::Runner dbtest;  Gtk::Main::run(dbtest);  } catch(jme::Exception x) {  
x.Display();  }  return 0;  }  This is what I have done so far, and 
following your advice I hade added 'sqlite3_finalize(stmt)' each time I am done 
with it. Al
 so, I have downloaded and installed 'SQLight Designer' and when opening the 
database file, I have just created, all that I can see is the words: SQLite 
format 3.  Come on you folk, you have more experience than me using SQLite, 
pich in!. What else do I need to do?   TIA   void 
jme::Runner::CreateTable(){  rc = sqlite3_prepare_v2(  db, /* Database handle 
*/  create_table.c_str() , /* SQL statement, UTF-8 encoded */  
create_table.length(), /* Maximum length of zSql in bytes. */  stmt, /* OUT: 
Statement handle */  NULL /* OUT: Pointer to unused portion of zSql */  );  
if(rc != SQLITE_OK) {  sqlite3_close(db);  std::cout  error prepare_v2:  
 rc  std::endl;  exit(-2);  }  rc = sqlite3_step(stmt);  if(rc != 
SQLITE_DONE) {  sqlite3_close(db);  std::cout  error sqlite3_step:   rc 
 std::endl;  exit(-3);  }  sqlite3_finalize(stmt);  }  
___  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] C++ programming - int sqlite3_prepare_v2() question

2012-06-22 Thread Arbol One
http://www.sqlite.org/cvstrac/wiki?p=ManagementTools 
 Since there seems to be a confusion about the application I am using to view 
the newly created table and the data entered to it, I asked the question you 
are referring to in order to establish a common ground, an application to view 
the data in which we can discus on.

 If you have an idea of a freeware I could use as a test bench, I would really 
appreciated if you let us know.

 TIA


- Original Message -
From: Pavel Ivanov
Sent: 06/22/12 07:10 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

  As I stated in my previous email, I used SQLight Designer to view the 
  database, which application would you recommend to view my database? This 
  question was asked million times on this list. Please search the archives. 
  Pavel On Fri, Jun 22, 2012 at 4:34 AM, Arbol One arbol...@programmer.net 
  wrote:  Thanks for the prompt response.  As I stated in my previous email, 
  I used SQLight Designer to view the database, which application would you 
  recommend to view my database? Please keep in mind that I am not able to 
  purchase a program, so it needs to be a free trial or a freeware.  On the 
  other hand, as far as you can see, should the code I have shown open a 
  database, create a table and then add data to the table?   Thanks!   
  - Original Message -  From: Pavel Ivanov  Sent: 06/21/12 01:08 PM 
   To: General Discussion of SQLite Database  Subject: Re: [sqlite] C++ 
  programming - int sqlite3_prepare_v2() questionAlso, I have 
  downloaded and installed 'SQLight D
 esigner' and when opening the database file, I have just created, all that I 
can see is the words: SQLite format 3. Apparently you open your database file 
in some plain text editor instead of in something that understands what SQLite 
database is. Pavel On Thu, Jun 21, 2012 at 12:22 PM, Arbol One 
arbol...@programmer.net wrote:  namespace jme {  class Runner : public 
Gtk::Window {  private:  jme::Exception* e; // Exception handler  sqlite3 
*db; // Data Base  sqlite3_stmt* stmt; // SQL statement  Glib::ustring 
dbName; // db name  Glib::ustring sName; // my name  Glib::ustring sAddress; 
// my address  Glib::ustring vfs; // MSWIN Identifier  int rc; // return code 
 int age; // my age  // SQL statement  Glib::ustring dbdata;  Glib::ustring 
create_table;  public:  Runner();  ~Runner();  void OpenDB();  void 
CreateTable();  void AddData();  };  }  void jme::Runner::CreateTable(){  
rc = sqlite3_prepare_v2(   db, /* Database handle */  create_table.c_str(
 ) , /* SQL statement, UTF-8 encoded */  create_table.length(), /* Maximum 
length of zSql in bytes. */  stmt, /* OUT: Statement handle */  NULL /* OUT: 
Pointer to unused portion of zSql */  );  if(rc != SQLITE_OK) {  
sqlite3_close(db);  std::cout  error prepare_v2:   rc  std::endl;  
exit(-2);  }  rc = sqlite3_step(stmt);  if(rc != SQLITE_DONE) {  
sqlite3_close(db);  std::cout  error sqlite3_step:   rc  std::endl;  
exit(-3);  }  sqlite3_finalize(stmt);  }  void jme::Runner::AddData(){  rc 
= sqlite3_prepare_v2(  db, /* Database handle */  dbdata.c_str() , /* SQL 
statement, UTF-8 encoded */  dbdata.length(), /* Maximum length of zSql in 
bytes. */  stmt, /* OUT: Statement handle */  NULL /* OUT: Pointer to unused 
portion of zSql */  );  if(rc != SQLITE_OK) {    }  rc = 
sqlite3_step(stmt);  if(rc != SQLITE_DONE) {    }  
sqlite3_finalize(stmt);  }  void jme::Runner::OpenDB()  {  rc = 
sqlite3_open_v2(dbName.c_str(),  d
 b, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,  NULL);  if(rc != SQLITE_OK) 
{    }  jme::Runner::Runner() {  dbName = sqliteTest.sql;  sName = 
ArbolOne;  sAddress = 1 Parkway Rd;  vfs = win32;  age = 22;  dbdata 
= INSERT INTO friend VALUES('Jamiil', '49 New Bridge', '49');  create_table 
= CREATE TABLE friend (name TEXT, address TEXT, age INT);  try {  
jme::gnu_io f;  f.deleteFile(dbName);  } catch(jme::Exception e) {  
std::cout  e.what()  std::endl;  }  OpenDB();  CreateTable();  
AddData();   }  jme::Runner::~Runner(){  sqlite3_close(db);  cout  Good 
bye!  endl;  }  int main(int argc, char *argv[]) {  try {  Gtk::Main 
kit(argc, argv);  jme::Runner dbtest;  Gtk::Main::run(dbtest);  } 
catch(jme::Exception x) {  x.Display();  }  return 0;  }  This is what I 
have done so far, and following your advice I hade added 
'sqlite3_finalize(stmt)' each time I am done with it. Al  so, I have 
downloaded and installed 'SQLigh
 t Designer' and when opening the database file, I have just created, all that 
I can see is the words: SQLite format 3.  Come on you folk, you have more 
experience than me using SQLite, pich in!. What else do I need to do?   TIA  
 void jme::Runner::CreateTable(){  rc = sqlite3_prepare_v2(  db, /* Database 
handle */  create_table.c_str() , /* SQL statement, UTF-8 encoded */  
create_table.length(), /* Maximum length of zSql in bytes. */  stmt, /* OUT: 
Statement handle */  NULL

Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

2012-06-21 Thread Arbol One
namespace jme {
 class Runner : public Gtk::Window {
 private:
 jme::Exception* e; // Exception handler
 sqlite3 *db; // Data Base
 sqlite3_stmt* stmt; // SQL statement
 Glib::ustring dbName; // db name
 Glib::ustring sName; // my name
 Glib::ustring sAddress; // my address
 Glib::ustring vfs; // MSWIN Identifier
 int rc; // return code
 int age; // my age
 // SQL statement
 Glib::ustring dbdata;
 Glib::ustring create_table;
 public:
 Runner();
 ~Runner();
 void OpenDB();
 void CreateTable();
 void AddData();
 };
 }
 void jme::Runner::CreateTable(){
 rc = sqlite3_prepare_v2(
 db, /* Database handle */
 create_table.c_str() , /* SQL statement, UTF-8 encoded */
 create_table.length(), /* Maximum length of zSql in bytes. */
 stmt, /* OUT: Statement handle */
 NULL /* OUT: Pointer to unused portion of zSql */
 );
 if(rc != SQLITE_OK) {
 sqlite3_close(db);
 std::cout  error prepare_v2:   rc  std::endl;
 exit(-2);
 }
 rc = sqlite3_step(stmt);
 if(rc != SQLITE_DONE) {
 sqlite3_close(db);
 std::cout  error sqlite3_step:   rc  std::endl;
 exit(-3);
 }
 sqlite3_finalize(stmt);
 }
 void jme::Runner::AddData(){
 rc = sqlite3_prepare_v2(
 db, /* Database handle */
 dbdata.c_str() , /* SQL statement, UTF-8 encoded */
 dbdata.length(), /* Maximum length of zSql in bytes. */
 stmt, /* OUT: Statement handle */
 NULL /* OUT: Pointer to unused portion of zSql */
 );
 if(rc != SQLITE_OK) {
 
 }
 rc = sqlite3_step(stmt);
 if(rc != SQLITE_DONE) {
 
 }
 sqlite3_finalize(stmt);
 }
 void jme::Runner::OpenDB() {
 rc = sqlite3_open_v2(dbName.c_str(),
 db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
 NULL);
 if(rc != SQLITE_OK) {
 
 }
 jme::Runner::Runner() {
 dbName = sqliteTest.sql;
 sName = ArbolOne;
 sAddress = 1 Parkway Rd;
 vfs = win32;
 age = 22;
 dbdata = INSERT INTO friend VALUES('Jamiil', '49 New Bridge', '49');
 create_table = CREATE TABLE friend (name TEXT, address TEXT, age INT);
 try {
 jme::gnu_io f;
 f.deleteFile(dbName);
 } catch(jme::Exception e) {
 std::cout  e.what()  std::endl;
 }
 OpenDB();
 CreateTable();
 AddData();

 }
 jme::Runner::~Runner(){
 sqlite3_close(db);
 cout  Good bye!  endl;
 }
 int main(int argc, char *argv[]) {
 try {
 Gtk::Main kit(argc, argv);
 jme::Runner dbtest;
 Gtk::Main::run(dbtest);
 } catch(jme::Exception x) {
 x.Display();
 }
 return 0;
 }
 This is what I have done so far, and following your advice I hade added 
'sqlite3_finalize(stmt)' each time I am done with it. Also, I have downloaded 
and installed 'SQLight Designer' and when opening the database file, I have 
just created, all that I can see is the words: SQLite format 3.
 Come on you folk, you have more experience than me using SQLite, pich in!. 
What else do I need to do?

 TIA

 void jme::Runner::CreateTable(){
 rc = sqlite3_prepare_v2(
 db, /* Database handle */
 create_table.c_str() , /* SQL statement, UTF-8 encoded */
 create_table.length(), /* Maximum length of zSql in bytes. */
 stmt, /* OUT: Statement handle */
 NULL /* OUT: Pointer to unused portion of zSql */
 );
 if(rc != SQLITE_OK) {
 sqlite3_close(db);
 std::cout  error prepare_v2:   rc  std::endl;
 exit(-2);
 }
 rc = sqlite3_step(stmt);
 if(rc != SQLITE_DONE) {
 sqlite3_close(db);
 std::cout  error sqlite3_step:   rc  std::endl;
 exit(-3);
 }
 sqlite3_finalize(stmt);
 }
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

2012-06-19 Thread Arbol One
Hi Igor.
 Since the purpose of this exercise is to create a simple table, could you tell 
me if this is all I have to do? Are there any other steps?

- Original Message -
From: Igor Tandetnik
Sent: 06/18/12 08:36 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

 Arbol One arbol...@programmer.net wrote:  Continuing with the questions and 
moving to the step three.  int sqlite3_step(sqlite3_stmt*);  ---  rc = 
sqlite3_step(stmt);  if(rc != SQLITE_DONE) {  sqlite3_close(db);  std::cout 
 error sqlite3_step:   rc  std::endl;  exit(-3);  }  Any 
suggestions? None. -- 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] C++ programming - int sqlite3_prepare_v2() question

2012-06-18 Thread Arbol One
LOL, some times I surprise myself with the most stupid of questions! Yes, you 
were very clear, Igor, sorry about that!!
 Continuing with the questions and moving to the step three.
 int sqlite3_step(sqlite3_stmt*);
 ---
 rc = sqlite3_step(stmt);
 if(rc != SQLITE_DONE) {
 sqlite3_close(db);
 std::cout  error sqlite3_step:   rc  std::endl;
 exit(-3);
 }
 Any suggestions?

- Original Message -
From: Igor Tandetnik
Sent: 06/17/12 06:41 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

 Arbol One arbol...@programmer.net wrote:  //2 . ) create a table  
sqlite3_stmt** stmt; Which part of sqlite3_stmt* stmt; did you find unclear? 
 std::string create_table(CREATE TABLE friend (name TEXT, address TEXT, age 
INT));  rc = sqlite3_prepare_v2(  db, /* Database handle */  
create_table.c_str() , /* SQL statement, UTF-8 encoded */  
create_table.length(), /* Maximum length of zSql in bytes. */  stmt, /* OUT: 
Statement handle */ Which part of pass stmt did you find unclear? -- 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


[sqlite] C++ programming - sqlite3_column() question

2012-06-18 Thread Arbol One
After creating a database, I, now, would like to create a table called 
'friend', but for some reason 'sqlite3_column()' reports zero.
 What elese do I have to do to have the table created, this is what I have so 
far done.
 int main() {
 sqlite3 *db; // Data Base
 sqlite3_stmt* stmt;
 int rc; // return code

 // SQL statement
 std::string create_table(CREATE TABLE friend (name TEXT, address TEXT, age 
INT));
 // 1.) Open database
 rc = sqlite3_open_v2(dbName.c_str(),
 db, 
 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
 NULL);
 if(rc != SQLITE_OK) {
 sqlite3_close(db);
 std::cout  error open_v2:   rc  std::endl;
 exit(-1);
 } else {
 std::cout  Welcome to a whole new world!  std::endl;
 std::cin.get();
 }
 // 2.) Convert SQL text into a prepared statement and receive a valid 
validated statement
 rc = sqlite3_prepare_v2(
 db, /* Database handle */
 create_table.c_str() , /* SQL statement, UTF-8 encoded */
 create_table.length(), /* Maximum length of zSql in bytes. */
 stmt, /* OUT: Statement handle */
 NULL /* OUT: Pointer to unused portion of zSql */
 );
 if(rc != SQLITE_OK) {
 sqlite3_close(db);
 std::cout  error prepare_v2:   rc  std::endl;
 exit(-2);
 }
 //3.) Evaluate the SQL stament passed to sqlite3_prepare_v2()
 rc = sqlite3_step(stmt);
 if(rc != SQLITE_DONE) {
 sqlite3_close(db);
 std::cout  error sqlite3_step:   rc  std::endl;
 exit(-3);
 }
 //3.1
 rc = sqlite3_column_count(stmt);
 std::cout  Number of colums:   rc  std::endl;
 sqlite3_finalize(stmt);
 sqlite3_close(db);
 std::cout  Good bye!  std::endl;
 return 0;
 }
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Arbol One
int sqlite3_open_v2(
 const char *filename, /* Database filename (UTF-8) */
 sqlite3 **ppDb, /* OUT: SQLite db handle */
 int flags, /* Flags */
 const char *zVfs /* Name of VFS module to use */
 );
 In my Windows 7 box, using MinGW I am trying to use sqlite in my c++ program, 
but the parameters used in int sqlite3_open_v2() are not totally clear to me 
and I hope you are able to help me.
 Here is an example of what I would like to do,

 void mydb(){
 std::string db_name(test);
 std::string my_name(Programmer);
 int my_age = MAX_INT;
 .

 rc = sqlite3_open_v2(db_name.c_str(),  *??1*, db, SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE,  *??2*);
 if(rc != SQLITE_OK){
 std::cout  error one  std::endl;
 exit(-1);
 }
 else{ std::cout  it's working! It's working  std::endl;}
 
 sqlite3_close(db);
 cout  Good bye!  endl;
 return 0;
 }

 What do I input as  *??1* and  *??2* ? and do I need to grab ??1 to later use 
it?
 Thanks folks!
 Please note, that I am trying to learn SQL as I learn how to apply this 
knowledge in c++, what you see above is pretty much all my knowledge of SQL, 
so, go easy on me, OK?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Arbol One
Thanks Stephan for the help, with a little bit of reading and a lot of your 
help, I have come to understand how opening a data base file in SQLite is done. 
Here is a code I came up with:

 void mydb(){
 std::string db_name(test);
 std::string my_name(Programmer);
 int my_age = MAX_INT;
 std::string vfs(win32);
 .
 rc = sqlite3_open_v2(dbName.c_str(), db, SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE, vfs.data());
 if(rc != SQLITE_OK){
 sqlite3_close(db_name);
 std::cout  naaa, you ain't got it yet... press any key and keep trying.  
std::endl;
 std::cin.get();
 exit(-1);
 } else {
 std::cout  Welcome to a whole new world!  std::endl;
 std::cin.get();
 }
 
 sqlite3_close(db_name);
 cout  Good bye!  endl;
 return 0;
 }
 Now, my next step is to create data tables, but that will be on another email.

- Original Message -
From: Stephan Beal
Sent: 06/17/12 11:25 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ programming - int sqlite3_open_v2() question

 On Sun, Jun 17, 2012 at 5:14 PM, Arbol One arbol...@programmer.net wrote:  
rc = sqlite3_open_v2(db_name.c_str(), *??1*, db, SQLITE_OPEN_READWRITE  | 
SQLITE_OPEN_CREATE, *??2*);  That is not the signature for open_v2: 
http://www.sqlite.org/c3ref/open.html  if(rc != SQLITE_OK){  std::cout  
error one  std::endl;  exit(-1);  Don't forget sqlite3_close() here! It 
must be called even on error.  What do I input as *??1* and *??2* ? and do I 
need to grab ??1 to later  use it?  You seem to have inserted an extra 
argument (??1) where the db handle (db) goes. The final parameter should be 
NULL unless you specifically know otherwise (you would know if that were the 
case). -- - stephan beal http://wanderinghorse.net/home/stephan/ 
http://gplus.to/sgbeal ___ 
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] vfs?

2012-06-17 Thread Arbol One
Using C/C++, is there a way to extract which file system is SQLite using?
 TIA
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] vfs?

2012-06-17 Thread Arbol One
Thanks for your prompt respnse.
 Well, no, really. I don't know where my application will be used. Maybe 
someone will use it under linux or OS2, all I know is that now I am coding in 
Win32.

- Original Message -
From: Igor Tandetnik
Sent: 06/17/12 02:02 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] vfs?

 Arbol One arbol...@programmer.net wrote:  Using C/C++, is there a way to 
extract which file system is SQLite using? You already know that - it's the one 
you've specified in a call to sqlite3_open_v2. What problem are you trying to 
solve? -- 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] C++ programming - int sqlite3_prepare_v2() question

2012-06-17 Thread Arbol One
int sqlite3_prepare_v2(
 sqlite3 *db, /* Database handle */
 const char *zSql, /* SQL statement, UTF-8 encoded */
 int nByte, /* Maximum length of zSql in bytes. */
 sqlite3_stmt **ppStmt, /* OUT: Statement handle */
 const char **pzTail /* OUT: Pointer to unused portion of zSql */
 );
 /*** Please note that this program is not ment to be funtional, it is only 
here to serve as a research bench. However, I am trying to make it as 
realisting as possible, so to keep it as real life as possible.***/
 void mydb(){
 sqlite3 *db;
 std::string db_name(test);
 std::string my_name(Programmer);
 int my_age = MAX_INT;
 std::string vfs(win32);
 //1 .) open||create a data base
 rc = sqlite3_open_v2(dbName.c_str(), db, SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE, vfs.data());
 if(rc != SQLITE_OK){
 sqlite3_close(db_name);
 std::cout  naaa, you ain't got it yet... press any key and keep trying.  
std::endl;
 std::cin.get();
 exit(-1);
 } else {
 std::cout  Welcome to a whole new world!  std::endl;
 std::cin.get();
 }

 *//2 . ) create a table 
 std::string create_table(CREATE TABLE friend (name TEXT, address TEXT, age 
INT));
 rc = sqlite3_prepare_v2(
 db, /* Database handle */
 creat_table.c_str() , /* SQL statement, UTF-8 encoded */
 ??, /* Maximum length of zSql in bytes. */
 ??, /* OUT: Statement handle */
 ?? /* OUT: Pointer to unused portion of zSql */
 );*
 ...
 }

 std::string create_table(CREATE TABLE friend (name TEXT, address TEXT, age 
INT));
 rc = int sqlite3_prepare_v2(
 db, /* Database handle */
 creat_table , /* SQL statement, UTF-8 encoded */
 ??, /* Maximum length of zSql in bytes. */
 ??, /* OUT: Statement handle */
 ?? /* OUT: Pointer to unused portion of zSql */
 );Here is where my question rises, how can I know Maximum length of zSql in 
bytes? All I know is that the maximum length of std::string is 255. Also, what 
are the values for the last two paramenters? (OUT: Statement handle and OUT: 
Pointer to unused portion of zSql).

 Thanks in advance

- Original Message -
From: Stephan Beal
Sent: 06/17/12 02:35 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ programming - int sqlite3_open_v2() question

 On Sun, Jun 17, 2012 at 7:39 PM, Arbol One arbol...@programmer.net wrote:  
std::cout  naaa, you ain't got it yet... press any key and keep  trying. 
 std::endl;  std::cin.get();  Glad it helped. Pedantic note: cin.get() will 
wait for ENTER to be pressed before returning, AFAIK. There is no portable way 
(in C/C++) to grab only the next keystroke from the console.  Now, my next 
step is to create data tables, but that will be on another  email.  
sqlite3_exec(), sqlite3_prepare(), sqlite3_bind_xxx(), sqlite3_step(), 
sqlite3_finalize() -- - stephan beal 
http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal 
___ 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] C++ programming - int sqlite3_open_v2() question

2012-06-17 Thread Arbol One
Thanks for the info.
 Yes, I read that page, but since the purpose of this exercise is to acquire a 
good understanding of SQLite under C++, I decided not to use the  
*sqlite3_exec* wrapper, but to execute each and every step of the development 
process. I know is not the fastest way, it involves more code, but it is 
serving me very, very well. In the future, I will use the wrapper, but for now 
I find it that it is necessary that I understand the long and tedious way... 
yes, I know... I am a masochist.

- Original Message -
From: Simon Slavin
Sent: 06/17/12 03:25 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] C++ programming - int sqlite3_open_v2() question

 On 17 Jun 2012, at 6:39pm, Arbol One arbol...@programmer.net wrote:  Now, 
my next step is to create data tables, but that will be on another email. It 
helps to read the documentation: http://www.sqlite.org/quickstart.html See 
the end of that page for a C example. 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] C++ programming - int sqlite3_prepare_v2() question

2012-06-17 Thread Arbol One
Thanks Igor for your help, it is much appreciated.

 Now my step two looks like this

 //2 . ) create a table 
 sqlite3_stmt** stmt; 
 std::string create_table(CREATE TABLE friend (name TEXT, address TEXT, age 
INT));
 rc = sqlite3_prepare_v2(
 db, /* Database handle */
 create_table.c_str() , /* SQL statement, UTF-8 encoded */
 create_table.length(), /* Maximum length of zSql in bytes. */
 stmt, /* OUT: Statement handle */
 NULL /* OUT: Pointer to unused portion of zSql */
 );
 if(rc != SQLITE_OK) {
 sqlite3_close(db);
 std::cout  error prepare_v2  std::endl;
 exit(-1);
 }

 however, this gives me a run time error that reads

 *#0  0x00446642 in ??() (??:??)*
 What did I do wrong?
- Original Message -
From: Igor Tandetnik
Sent: 06/17/12 05:41 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

 Arbol One arbol...@programmer.net wrote:  rc = 
sqlite3_open_v2(dbName.c_str(), db, SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE, vfs.data()); Just pass NULL for the last parameter. There 
is very rarely a need to pass anything else.  *//2 . ) create a table  
std::string create_table(CREATE TABLE friend (name TEXT, address TEXT, age 
INT));  rc = sqlite3_prepare_v2(  db, /* Database handle */ Drop the 
ampersand. Note that, while sqlite3_open_v2 takes sqlite3** (two stars), 
sqlite3_prepare_v2 wants sqlite3* (one star).  creat_table.c_str() , /* SQL 
statement, UTF-8 encoded */  ??, /* Maximum length of zSql in bytes. */ You 
can pass creat_table.length(), or simply pass -1 and have SQLite accept all 
characters up to the terminating NUL.  ??, /* OUT: Statement handle */ Same 
story as with sqlite3_open_v2 and DB handle. You declare a variable like 
sqlite3_stmt* stmt;, then pass stmt.  ?? /* OUT: Pointer to unused portion 
of zSql */ Just pass NULL. This is used when y
 ou have a single string containing multiple statements. Note that 
sqlite3_prepare_v2 only prepares the statement, but doesn't actually execute 
it. To run the statement, you would call sqlite3_step. After you are done, call 
sqlite3_finalize to free resources associated with the statement; and 
sqlite3_close to close your database connection. -- 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


[sqlite] SQLite and C++

2012-06-13 Thread Arbol One
Anyone knows where I can find some examples of how C++ interfaces with SQLite? 
I just need to see some code that is functional and not just some snips of how 
it maybe-should-possibly work.
 TIA
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Good books to lear SQL using SQLite?

2012-04-30 Thread Arbol One
I am learning SQL using SQLite, can anyone tell me of a good book to learn SQL 
using SQLite?

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


[sqlite] We have a snake in paradise

2012-04-03 Thread Arbol One
We have a snake in paradise. Pls Administrator, remove the OP of this
message. We cannot afford this kind of distractions from SQLite or
distortion of what SQLite is.

TIA

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Darko Filipovic
Sent: Monday, April 02, 2012 9:28 AM
To: goran6...@hotmail.com; sqlite-users-requ...@sqlite.org;
s.tij...@gmail.com; blackwhit...@hotmail.com; darko_...@yahoo.com;
balkanskispijun...@yahoo.com; sqlite-users@sqlite.org
Subject: [sqlite] (no subject)

a
href=http://tourism.singapore18.com/wp-content/uploads/cache/02efpk.html;
http://tourism.singapore18.com/wp-content/uploads/cache/02efpk.html/a
___
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] Documentation in PDF

2011-11-08 Thread Arbol One
Any one knows where I can get the documentation in
http://www.sqlite.org/download.html, but in PDF format?

 

TIA 

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


[sqlite] Learning SQL using SQLite

2011-11-08 Thread Arbol One
Hello everyone, I have downloaded the sqlite-amalgamation-3070900.zip
http://www.sqlite.org/sqlite-amalgamation-3070900.zip  file and I have
incorporated the source code to a small program I am building. I want to use
SQLite as my database, but I have little to nil knowledge of SQL, can anyone
of you recommend me a book about SQL that I can use. I would be using C++
and gtkmm as back end. 

TIA 

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


Re: [sqlite] Using SQLite on Windows 64bit

2011-10-29 Thread Arbol One
Yes, compiling to 32-bit is nice. It is like dancing at the tunes of Earth
Wind and Fire, h, those were the days. Like the old good songs, the
32bit apps are a good memory, many people like it, but they are a thing of
the past. We are developers and anyone of us who stays behind, is left
behind. Not having the option of SQLite-64 is a major drawback and will
leave us behind. So, come on folks, pull up your socks and let's get the
SQLite apps into the 21st century, shall we?

 

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


[sqlite] Testing SQLite in C++

2011-10-20 Thread Arbol One
Hey kids, I am testing SQLite in the hope that I can use it in my program,
but I get this confusing error msg, Can anybody help?

 

Error message



D:\dev\sqlitetest\main.cpp:14:10: error: 'sqlite3_api' was not declared in
this scope

 

Code

~

#include iostream

#include sqlite/sqlite3.h

#include sqlite/sqlite3ext.h

#include glibmm/ustring.h

int main() {

sqlite3 *db;

Glib::ustring dbName(sqliteTest);

int rc;

 

rc = sqlite3_open(dbName.c_str(), db); // ç Error Message comes as soon
as I add this line

 

std::cout  Hello world!  std::endl;

return 0;

}

 

Thanks in advance!!

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


Re: [sqlite] Testing SQLite in C++

2011-10-20 Thread Arbol One
Excellent!

Thanks dude!

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Pavel Ivanov
Sent: Thursday, October 20, 2011 11:06 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Testing SQLite in C++

Do not include sqlite3ext.h. Applications need only sqlite3.h.

Pavel


On Thu, Oct 20, 2011 at 11:02 AM, Arbol One arbol...@gmail.com wrote:
 Hey kids, I am testing SQLite in the hope that I can use it in my program,
 but I get this confusing error msg, Can anybody help?



 Error message

 

 D:\dev\sqlitetest\main.cpp:14:10: error: 'sqlite3_api' was not declared in
 this scope



 Code

 ~

 #include iostream

 #include sqlite/sqlite3.h

 #include sqlite/sqlite3ext.h

 #include glibmm/ustring.h

 int main() {

    sqlite3 *db;

    Glib::ustring dbName(sqliteTest);

    int rc;



    rc = sqlite3_open(dbName.c_str(), db); // ç Error Message comes as
soon
 as I add this line



    std::cout  Hello world!  std::endl;

    return 0;

 }



 Thanks in advance!!

 ___
 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] Where is my posting?

2011-10-19 Thread Arbol One
Hey boys and girls!

Anyone knows why is it that I cannot see my own postings, worst yet! Nobody
replies to my postings?!

How can I know if my email actually is being considered by other members of
the list or if it was never posted?

 

TIA

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


Re: [sqlite] Where is my posting?

2011-10-19 Thread Arbol One
OH! nice! thanks Taleeb, now I know it is working.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Taleeb Anwar
Sent: Wednesday, October 19, 2011 7:30 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Where is my posting?

Now that is a difficult question (in fact one of the most difficult
questions of all) -- why nobody replies to your posts.

Well, I don't know the answer - but am replying - to confirm that your posts
are being received by others. And for the questions you didn't get any
answer -- try rephrasing them or adding some code or something to make them
more clear (for I can't think of any other reason for such an active group
to remain unresponsive to your questions)

Regards
Taleeb Anwar

*Ghurbat men Hon Agar Hum, Rehta Hai Dil Chicken men!!*




On Wed, Oct 19, 2011 at 4:48 PM, Arbol One arbol...@gmail.com wrote:

 Hey boys and girls!

 Anyone knows why is it that I cannot see my own postings, worst yet!
Nobody
 replies to my postings?!

 How can I know if my email actually is being considered by other members
of
 the list or if it was never posted?



 TIA

 ___
 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] FW: How about a proper forum rather than an e-mail list

2011-10-18 Thread Arbol One
yap, I agree with you, email better.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Mark Schonewille
Sent: Tuesday, October 18, 2011 5:57 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] FW: How about a proper forum rather than an e-mail
list

Hi,

I prefer mailing lists because I can read and write e-mails while I'm online
(.e.g while travelling) and I can easily flag important messages, copy text
and syntax in plain format or print (part of) an e-mail and I can also
organise the message in the wy I see fit. A true geek uses e-mail, no
forums.

However, if you really want a forum, install one on your web server and find
out how many people use it.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

See what you get with only a small contribution. All our LiveCode downloads
are listed at http://qery.us/zr

On 18 okt 2011, at 11:35, Frank Missel wrote:

 I think that the sqlite-users e-mail list has enough traffic to warrant a
 proper forum. 
 
 Has this been considered?
 

___
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] FW: How about a proper forum rather than an e-mail list

2011-10-18 Thread Arbol One
Sorry folks, but it does not matter who is right or wrong, if you want to
open a forum... go ahead, you can even announce it here; those interested
will follow your idea, but for the time being you are taking a lot of
bandwidth, time and creating distraction. Please, I encourage you to open
the forum and to announce the existence of it here, but stop posting the
plusses and minuses of it. 
Thanks in advance!!

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Frank Missel
Sent: Tuesday, October 18, 2011 10:10 AM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] FW: How about a proper forum rather than an e-mail
list

Hi Mark,

Well, perhaps you are right. 

But I am not going to take on that. 
I am a user of SQLite and can perhaps help with some posts and suggestions
now and then.
So I am just going to throw in the idea and state the pros vs. cons as I see
them .

Best regards,

Frank


 -Original Message-
 From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
 boun...@sqlite.org] On Behalf Of Mark Schonewille
 Sent: 18 October 2011 21:54
 To: General Discussion of SQLite Database
 Subject: Re: [sqlite] FW: How about a proper forum rather than an e-mail
list
 
 Hi,
 
 I know from experience that there really is no point whatsoever in
discussing
 whether a forum is better than mail or not. People are just not going to
 agree. Just set up your forum and find out whether you're going to have
 subscribers.
 
 --
 Best regards,
 
 Mark Schonewille
 
 Economy-x-Talk Consulting and Software Engineering
 Homepage: http://economy-x-talk.com
 Twitter: http://twitter.com/xtalkprogrammer
 KvK: 50277553
 
 See what you get with only a small contribution. All our LiveCode
downloads
 are listed at http://qery.us/zr
 
 On 18 okt 2011, at 15:49, Frank Missel wrote:
 
  boun...@sqlite.org] On Behalf Of Jean-Denis MUYS
 
  1. Several subject forums as mentioned
 
  Mail can have as many subjects as desired
 
  Well, so can forum posts. The point is that the forum is divided into
  main categories above the subject of the post
 
 
  2. Better view of threads with several levels being immediately
  displayed
 
  My mail client threads far better than most forums (fora?)
 
  I seriously doubt that :-).
  I mean how much better than a totally ordered hierarchy with several
  levels and forks can it be.
 
  But perhaps your mail client is very good. Which one do you use?
 
  Also, in a forum, you can see posts from a selected author sorted by
date.
 
 
  3. Preview of entries and  editing of them even after they are
  posted (by the author)
 
  Which can be seen as a liability
 
  To be sure.
  But then again until anyone has posted a reply. It can be used to
  correct a typo or add info (where it makes sense rather than add a new
 post).
 
 
  4. Formatted rather than plain text
 
  Which mail is capable of
 
  Any formatting is stripped. At least it is so on the sqlite-users
mail-list.
 
 
  5. No need for e-mail-addresses to be exposed
 
  Couldn't a mailing list hide email addresses too?
 
  Perhaps it could.
  I find, however, that e-mails are spread all over the place on the
  sqlite-users mailing list. So it is not being done here.
  That is one of my big objections as it invariable leads to spamming of
  the members.
 
 
  On the other hand, I find mailing lists much better: I can read them
  off
  line, I
  can also answer them off line (my client will send my answers as soon
  as
  it
  gets online), I can archive any and/or all posts that I find valuable.
 
  I get messages from others when they are on their way to work or home
  sitting in trains and busses.
  Mostly people are just online through wireless or mobile networks. It
  is considered in to be able to access the Internet at all times in
  all places, so I find that point a bit moot nowadays.
 
 
  In fact, when fora (forums?) propose a mailing list interface (i.e.
  google groups), I prefer subscribing to them as a mailing list.
 
  Even better than mailing lists: newsgroups. Except my company only
  lets us use port 80 in addition to the mail gateway, so I can't use
 newsgroups.
 
  Who am I tell someone what to prefer.
  I just find, however, it is a bit religious like choice of OS or
  gadgets. I can see that e-mail lists can work and in the past could
  have a lot of advantages. Nowadays, I find not as many good reasons to
  prefer them over a proper forum which have some really nice features.
 
 
  /Frank Missel
 
 ___
 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

[sqlite] SQLite

2011-10-07 Thread Arbol One
Hey kids.

Looking at the choices given at http://www.sqlite.org/download.html, I would
like to know what would be the best way to add SQLite to my app. 

I am using Windows 7-64bit as the OS and Code::Blocks with MinGW/GNU C++. 

 

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


[sqlite] Fwd: A DLL for my WinXP

2010-06-21 Thread Arbol One
Helloo! is any body there??!!
nock nock ... Is this group dead??!!

Where can I find the DLL file for my winxp?
TIA



 Original Message 
Subject:A DLL for my WinXP
Date:   Sun, 20 Jun 2010 20:59:20 -0400
From:   Arbol One arbol...@gmail.com
To: sqlite-users@sqlite.org



Where can I find the DLL file for my winxp?
TIA
-- 
This email is for the sole use of the intended recipient and may contain
confidential or privileged information. Unauthorized use of its contents
is prohibited. If you have received this email in error, please notify
the sender immediately via return email and then delete the original
email. Think Green before printing this email

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


[sqlite] A DLL for my WinXP

2010-06-20 Thread Arbol One
Where can I find the DLL file for my winxp?
TIA
-- 
This email is for the sole use of the intended recipient and may contain 
confidential or privileged information. Unauthorized use of its contents 
is prohibited. If you have received this email in error, please notify 
the sender immediately via return email and then delete the original 
email. Think Green before printing this email
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users