Re: [sqlite] real time gui updates

2006-06-28 Thread John Stanton
In that case your application knows whenever the database is changed and 
can call a refresh routine.


Rob Menegon wrote:
No a single user/instance of the application reading from the database. 



Rob Menegon
 
MenMac Services Pty Ltd

ABN: 54 088 928 321
 
Mobile:  +61 416 271 348

Fax:   +61 2 8569 2063
Phone:   +61 2 9482 7193
Email: [EMAIL PROTECTED]
Skype:   rmenegon

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 28 June 2006 10:45 PM

To: sqlite-users@sqlite.org
Subject: Re: [sqlite] real time gui updates

Rob Menegon wrote:

I have an application that displays data retrieved from various SQLite 
tables.  As the data within the tables changes I want these changes 
reflected in the application real time.


Can someone advise on the best way of doing this?

Rob Menegon




Do you have multiple independent users?





RE: [sqlite] real time gui updates

2006-06-28 Thread Rob Menegon
No a single user/instance of the application reading from the database. 


Rob Menegon
 
MenMac Services Pty Ltd
ABN: 54 088 928 321
 
Mobile:  +61 416 271 348
Fax:   +61 2 8569 2063
Phone:   +61 2 9482 7193
Email: [EMAIL PROTECTED]
Skype:   rmenegon

-Original Message-
From: John Stanton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 28 June 2006 10:45 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] real time gui updates

Rob Menegon wrote:
> I have an application that displays data retrieved from various SQLite 
> tables.  As the data within the tables changes I want these changes 
> reflected in the application real time.
>  
> Can someone advise on the best way of doing this?
>  
> Rob Menegon
>  
> 
Do you have multiple independent users?



RE: [sqlite] sqlite3_free_table question

2006-06-28 Thread Richard Boyd
Dennis,

Ok thanks for the quick response. I'll persevere with that then and get back
if I still have problems.

Thanks,
Richard. 





Re: [sqlite] sqlite3_free_table question

2006-06-28 Thread Dennis Cote

Richard Boyd wrote:

Basically I have a structure I use to hold data results:

//=
typedef struct {
  char   *sqlStatement; // Either the sqlstatement to be executed or the
last statement that was executed
  char   **results; // the result stored in an array
  char   *err_msg;  // the error message
  intnumrows;   // number of rows of results
  intnumcols;   // the number of columns of data returned
} RESULT_T;
//===

I pass this structure to a wrapper function that ultimately calls
sqlite3_get_table and returns the results structure on tresults

//===
int execute_command (size_t   nbytes,  char *command,   RESULT_T
*tresults)
//===

In the function that calls execute_command(), I want to free up the memory
that was allocated by sqlite3_get_table().

Do I just call the free function like this:
sqlite3_free_table(tresults.results); (assuming that I created a variable
called ‘tresults’ of type RESULT_T in the calling function).

Also, how do I free up the error messages? What if there are no results
returned by sqlite3_get_table, can I still attempt to free up the memory
with ‘sqlite3_free_table’

I appreciate you reading down this far, and sorry if my code snips are hard
to follow!!

  

Richard,

Your call to sqlite3_free_table is correct.

You free the error message by calling sqlite3_free(tresult.err_msg).

If either pointer returned by sqlite3_get_table() is NULL, then no 
memory was allocated, so there is no need to free it, however I believe 
it should be safe to call the free routines with a NULL pointer.


HTH
Dennis Cote



[sqlite] sqlite3_free_table question

2006-06-28 Thread Richard Boyd
Hi all,

Firstly, forgive me for a slightly naïve question; I don’t normally code in
C and I’m having problems freeing up memory.

Basically I have a structure I use to hold data results:

//=
typedef struct {
  char   *sqlStatement; // Either the sqlstatement to be executed or the
last statement that was executed
  char   **results; // the result stored in an array
  char   *err_msg;  // the error message
  intnumrows;   // number of rows of results
  intnumcols;   // the number of columns of data returned
} RESULT_T;
//===

I pass this structure to a wrapper function that ultimately calls
sqlite3_get_table and returns the results structure on tresults

//===
int execute_command (size_t   nbytes,  char *command,   RESULT_T
*tresults)
//===

In the function that calls execute_command(), I want to free up the memory
that was allocated by sqlite3_get_table().

Do I just call the free function like this:
sqlite3_free_table(tresults.results); (assuming that I created a variable
called ‘tresults’ of type RESULT_T in the calling function).

I’ve tried quite a few permutations and am never quite sure if I’ve actually
freed up the memory. Is there a fool proof way to check?

Also, how do I free up the error messages? What if there are no results
returned by sqlite3_get_table, can I still attempt to free up the memory
with ‘sqlite3_free_table’

I appreciate you reading down this far, and sorry if my code snips are hard
to follow!!

TIA
Richard.



Re: [sqlite] sqlite3_free()

2006-06-28 Thread Kervin L. Pierre
Hello,

--- Dennis Cote <[EMAIL PROTECTED]> wrote:

> This really has nothing to do with the Windows DLL
> system. It is simply 

Thanks for the explanation.  Wondered what that
bug reporter was talking about :)

There's a lot Windows does wrong, we don't have
to go around making up stuff :)

SQLite could export its memory management
routines as function pointers to the host app.
And have the host app provide their
implementations if desired.  That would solve
this issue amongst others.

Best regards,
Kervin



Re: [sqlite] hard copy docs

2006-06-28 Thread Jay Sprenkle

On 6/28/06, Dennis Jenkins <[EMAIL PROTECTED]> wrote:

>
The developers at my company have dual-headed displays.  Very nice.  I
highly recommend that others try it if they can.  It makes debugging
much easier when you can have your app open on one monitor and the
debugger on the other.  Or when you want to read API docs on one and
code on the other.  Or run real-time system / performance monitoring and
the target app, both full screen at the same time.  Very nice.


In the graphics world it's not uncommon to have three. One for the editing
program's workspace, one for the rather large tool palette, and another
for the rendered output from the program.


[sqlite] hard copy docs

2006-06-28 Thread [EMAIL PROTECTED]
Hi,
I am pretty much a hard copy guy too. But about a month ago I purchased a dual 
output video card and a second monitor (LCD). Total price $270. Now I have the 
docs on one screen while a work on the other. I like it much better than I 
thought I would.
Bill
 


Re: [sqlite] Preferred way to copy/flush new memory db to disk db ?

2006-06-28 Thread Jay Sprenkle

On 6/28/06, RohitPatel <[EMAIL PROTECTED]> wrote:


My requirements are
> database file must be removed from disk if any error while
> creating/copying tables, records or
> indices
> other application or other instance of same app must not be able to access
> the database, till
> database is not ready with necessary minimum tables and records.

So to avoid other app accessing, I thought of creating memory db.


Just write it to use the disk. It's not dramatically slower and you don't need
to write code to flush and load the database.


Re: [sqlite] real time gui updates

2006-06-28 Thread John Stanton

Rob Menegon wrote:

I have an application that displays data retrieved from various SQLite
tables.  As the data within the tables changes I want these changes
reflected in the application real time.
 
Can someone advise on the best way of doing this?
 
Rob Menegon
 


Do you have multiple independent users?


Re: [sqlite] How to get column description from table using SQL

2006-06-28 Thread John Stanton

blins wrote:

Hi sqlite-users@sqlite.org,

  How to get column description from table using SQL

--
 А у нас как не было порядка, так и есть! 
С наилучшими пожеланиями,

 blins  mailto:[EMAIL PROTECTED]


Access SQLITE_MASTER.


Re: [sqlite] How to get column description from table using SQL

2006-06-28 Thread Kurt Welgehausen
blins <[EMAIL PROTECTED]> wrote:

>   How to get column description from table using SQL

pragma table_info()




Regards


Re: [sqlite] Preferred way to copy/flush new memory db to disk db ?

2006-06-28 Thread RohitPatel9999

My requirements are 
> database file must be removed from disk if any error while
> creating/copying tables, records or 
> indices 
> other application or other instance of same app must not be able to access
> the database, till 
> database is not ready with necessary minimum tables and records. 

So to avoid other app accessing, I thought of creating memory db.
Rohit
-- 
View this message in context: 
http://www.nabble.com/Preferred-way-to-copy-flush-new-memory-db-to-disk-db---tf1843573.html#a5081614
Sent from the SQLite forum at Nabble.com.



Re: [sqlite] Which is most appropriate encoding ?

2006-06-28 Thread RohitPatel9999

> FWIW, if Windows is your only target, UTF-16 is the best choice for 
> you, because wchar_t is in UTF-16 on Windows and you can avoid some 
> string conversion in this case, while still be able to enable the 
> stuff for other OSes as soon as there is a need for it. 
>
> Alexei Alexandrov 

I think wchar_t will not work on Windows 98. (I do not want to use MS
Unicode layer on Windows98).
I need my app to work on Windows 98 also. 

Rohit

-- 
View this message in context: 
http://www.nabble.com/Which-is-most-appropriate-encoding---tf1780532.html#a5081544
Sent from the SQLite forum at Nabble.com.



Re: [sqlite] real time gui updates

2006-06-28 Thread Peter Cunderlik

On 6/28/06, Rob Menegon <[EMAIL PROTECTED]> wrote:


I have an application that displays data retrieved from various SQLite
tables.  As the data within the tables changes I want these changes
reflected in the application real time.

Can someone advise on the best way of doing this?


Try sqlite3_update_hook function.
(http://www.sqlite.org/capi3ref.html#sqlite3_update_hook)

Or you can create a trigger which in turn calls your own C function.
(http://www.sqlite.org/capi3ref.html#sqlite3_create_function)

Peter


Re[4]: [sqlite] How to get column description from table using SQL

2006-06-28 Thread blins
Ïðèâåò C.Peachment,

Wednesday, June 28, 2006, 12:55:46 PM, you wrote:

CP> On Wed, 28 Jun 2006 12:40:52 +0600, blins wrote:

  How to get column description from table using SQL

>>CP> To get table definition for '':

>>CP> select sql from sqlite_master where type='table' and name='';

>>I need column definition.


CP> Sqlite does not require that columns be typed so
CP> they can hold anything. You need to read the table
CP> definition to see what the designer expects will be
CP> stored in each column.

I develop db schema updater and I need column definition for building
update script.



Re: Re[2]: [sqlite] How to get column description from table using SQL

2006-06-28 Thread C.Peachment
On Wed, 28 Jun 2006 12:40:52 +0600, blins wrote:

>>>  How to get column description from table using SQL

>CP> To get table definition for '':

>CP> select sql from sqlite_master where type='table' and name='';

>I need column definition.


Sqlite does not require that columns be typed so
they can hold anything. You need to read the table
definition to see what the designer expects will be
stored in each column.





Re: Re: [sqlite] Multibyte

2006-06-28 Thread Anne . Kirchhellen

> I am confused what are you trying to acheive by building a Unicode
> DLL?

I'm really confused to... ;-)

OK. The Facts:

I create SQLite-Release-DLL's, one Unicode, one MCBS
I create SQLite-Debug-Libs with symbolic informations, also 
Unicode and MCBS. For all this I use the Source-Version 3.3.5.

Now I create a Test-Application. Its a test for hold values in 
a COleVariant-List: Strings, Floats and Integers.

I build it like the following code in a for(a++)-Loop:
   tmp.Format(_T("COleVariant Insert: %i"), a);
   colevar1 = COleVariant(tmp);
   colevar2 = COleVariant(long(256 * a));
   colevar3 = COleVariant(double(123456 / double(a)));
(Remember... its only a test)

Later, i receive the values again to store they to DB:
   CString tmp = (TCHAR *) _bstr_t();
   int len = (int) tmp.GetLength() * sizeof(TCHAR);
   _sqlite3_bind_text(pRecordset, 1, tmp, len, NULL);

And even this one doesnt work. The stored Values are buggy in DB.

If I do the following directly without COleVariant, it work's right:
   tmp.Format(_T("COleVariant Insert: %i"), a);
   int len = (int) tmp.GetLength() * sizeof(TCHAR);
   _sqlite3_bind_text(pRecordset, 1, tmp, len, NULL);
And that is the thing, i cannot understand.

Now i found in the Docu "SQLITE_TRANSIENT". I test it like
this and all Lib's, Dll's and Test-Apps are working right:
   _sqlite3_bind_text(pRecordset, 1, tmp, len, SQLITE_TRANSIENT);

Is that ok..?... I'm a little bit unstable, what i have to do/think.

Best Greetings, Anne
-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail


Re[2]: [sqlite] How to get column description from table using SQL

2006-06-28 Thread blins
Ïðèâåò C.Peachment,

Wednesday, June 28, 2006, 11:47:09 AM, you wrote:

CP> On Wed, 28 Jun 2006 10:29:47 +0600, blins wrote:


>>  How to get column description from table using SQL

CP> To get table definition for '':

CP> select sql from sqlite_master where type='table' and name='';

I need column definition.



-- 
?? ??, ? , ? ??.
Ñ íàèëó÷øèìè ïîæåëàíèÿìè,
 blinsmailto:[EMAIL PROTECTED]