Re: [sqlite] Storing monetary values and calculations

2007-08-30 Thread RohitPatel9999
Hi John If sourcecode for that type (DECIMAL) is available for public, please let us know the link and we can explore it for SQLite. Thanks John Stanton wrote: > > That is an interesting way to store money. We developed a fixed point > arithmetic library of arbitrary precision using the alg

Re: [sqlite] Looking for a cryptographic library

2007-08-26 Thread RohitPatel9999
Please look at the following link, for few easy-to-use free simple code-packages (two or three) for Encryption and Decryption. http://www.efgh.com/software/ Rohit -- View this message in context: http://www.nabble.com/Looking-for-a-cryptographic-library-tf4298572.html#a12334506 Sent from the

Re: [sqlite] Storing monetary values and calculations

2007-08-26 Thread RohitPatel9999
While doing currency math, a useful money class at following link, may be used as a a reference. http://www.di-mare.com/adolfo/p/money.htm Yet Another C++ Money Class (by Adolfo Di Mare), The C Users Journal, Vol.10 No.4, pp [58-64], April 1992 Rohit. -- View this message in context: http://ww

Re: [sqlite] Storing monetary values and calculations

2007-08-24 Thread RohitPatel9999
Some applications/tools are using Integers to Store money/currency values. Similar built-in implementation for such Currency/Money Data Types is available in MS SQL Server and also in Visual Basic For Applications. In such data types, data is stored as integer only (no decimal point is stored). S

[sqlite] RE: Question regarding INTEGER PRIMARY KEY (zero value in column) ?

2007-07-12 Thread RohitPatel9999
Hi I have a Question regarding INTEGER PRIMARY KEY (zero value in column) ? Example table => create table {id INTEGER PRIMARY KEY, name TEXT}; Is it ever possible that value 0 (zero) will be inserted in a column declared as INTEGER PRIMARY KEY (and not as AUTOINCREMENT) ? Inserts are always wit

[sqlite] RE: How do I know what DBs I have attached?

2007-03-09 Thread RohitPatel9999
Command Syntax => ATTACH [DATABASE] database-filename AS database-name If it is possible, keep database-name unique for perticular database-filename i.e. when issuing attach database command, everytime it should be same for perticular database-filename. So no need to track, just try to attach db

Re: [sqlite] import operation - primary key need to be automatically generated by SQLite (not from csv file)

2007-03-08 Thread RohitPatel9999
Friends, for value of fist column in csv, any of the following do not work (e.g. '', null, 'null' ) ,'name1' '','name2' null,'name3' 'null','name4' Table is Create table t1 { id INTEGER PRIMARY KEY, name TEXT } No workaround to import null value from csv file for INTEGER PRIMARY KEY ?

Re: [sqlite] import operation - primary key need to be automatically generated by SQLite (not from csv file)

2007-03-07 Thread RohitPatel9999
csv file is generated by a program. Program generatin csv do not know the existing id values from database table. Program can keep id blank or '' or null or some suitable value in csv file, which SQLite import should understand to generate next id automatically by SQLite itself to use it as pri

[sqlite] import operation - primary key need to be automatically generated by SQLite (not from csv file)

2007-03-06 Thread RohitPatel9999
/* SQLite 3.3.8 (Windows) used */ /* table t1 */ /* only two columns are given because other columns are irrelevant here */ create table t1 (id INTEGER PRIMARY KEY, name TEXT); /* few sample records from csv file data.csv */ 1,'name_text_1' 2,'name_text_2' 3,'name_text_3' 4,'name_text_4' /* imp

Re: [sqlite] Extra functions - New Project?

2006-10-18 Thread RohitPatel9999
Mike When are you planning to put code of your SQL functions for SQLite ? Waiting...eagerly... I may try to use it in my app. Thanks Rohit -- View this message in context: http://www.nabble.com/Extra-functions---New-Project--tf1674436.html#a6887312 Sent from the SQLite mailing list archive a

Re: [sqlite] DOUBLE / REAL column affinity, any difference ?

2006-09-30 Thread RohitPatel9999
Please ignore Q1 and Q2. I already found answer to Q1 and Q2. Rohit. -- View this message in context: http://www.nabble.com/DOUBLE---REAL-column-affinity%2C-any-difference---tf2363636.html#a6585007 Sent from the SQLite mailing list archive at Nabble.com. --

[sqlite] DOUBLE / REAL column affinity, any difference ?

2006-09-30 Thread RohitPatel9999
Hi create table t1 ( c1 REAL, c2 DOUBLE ); In above table, Q1. What will be column affinity of column c1 ? NUMERIC ? Q2. What will be column affinity of column c2 ? NUMERIC ? Q3. If I use DOUBLE in place of REAL, will there be any consequence / performance penalty Note: I am using S

[sqlite] record size limit ???

2006-09-28 Thread RohitPatel9999
Hi Q1. Need to know if there is maximum limit for record size ? Q2. What are the consequence of using such large record size ? I may need large record size in two-three tables. In two or three of my tables, I may need to have 64 columns or more and maximum record size may reach to approx. 2 MB

Re: [sqlite] Using SQLite on networked drive

2006-09-25 Thread RohitPatel9999
Thomas It is not safe to use SQLite on networked drive because of file locking problems and how OS caching takes place. Please refer answers by DRH above as well as in other question-answers. Different OS have different file locking and caching mechanism. Probably Windows 2000 might have suit

Re: [sqlite] Using SQLite on networked drive

2006-09-25 Thread RohitPatel9999
I have read articles and understood that it is not safe to access SQLite database file on network drive. (on all windows). But what about Windows 2000 (Server) ??? i.e. If SQLite (3.3.4 or 3.3.6) database file resides on disk drive of Windows 2000 Server, then is it safe to access that SQLite d

Re: [sqlite] How to maintain EXCLUSIVE access to database continuously ?

2006-09-24 Thread RohitPatel9999
Thanks for alternative ideas. In my app, user need Exclusive mode occassionally. But when uses Exclusive mode, user may enter/import some data or may change permissions for other users, or some report generation. User may use Exclusive mode for few minutes to may be 1-2 hours. That time no other

Re: [sqlite] How to maintain EXCLUSIVE access to database continuously ?

2006-09-24 Thread RohitPatel9999
Some additional info User (Client App) connects to middle-tier application-server and then user may access any one company in normal or exclusive mode. Only application-server communicates with database. If user wants exclusive access, Application-Server needs to maintain that exclusive access to

[sqlite] How to maintain EXCLUSIVE access to database continuously ?

2006-09-24 Thread RohitPatel9999
Hi SQLite experts/users In my multi-user app (Win32, SQLite3.3.4), one database file for each company (accounts). User can access company accounts in two modes, normal mode and exclusive mode. In exclusive mode, only one user will have access, no other user should be able to access that company

Re: [sqlite] concurent writes and locks

2006-08-11 Thread RohitPatel9999
>> >> You can avoid the deadlock by having the mixed reader/writer start its >> transaction with BEGIN IMMEDIATE. >> >> Igor Tandetnik Will BEGIN IMMEDIATE surely avoid deadlock ? or BEGIN EXCLUSIVE is better ? i.e. in such cases, what advantage BEGIN IMMEDIATE gives over BEGIN EXCLUSIVE ? T

Re: [sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-11 Thread RohitPatel9999
Many thanks for helping. While using SQLite dll Version 3.3.4 on Windows - Multiple threads/processes access SQLite database, - Each thread does some SELECTs, INSERTs or UPDATEs. If for some single SELECT (where user input is used in SQL statement, so to avoid SQL injection), sqlite3_prepare(

Re: [sqlite] Recovery tool ?

2006-08-09 Thread RohitPatel9999
Once I experienced a problem during testing where multi-threaded Win32 Application (using SQLite 3.3.4) was running (in development environment) and due to power-failure, rollback journal file was OK but disk bad-sector damaged the sqlite db-file. When I restarted App, db could not be opened (da

Re: [sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-09 Thread RohitPatel9999
Thanks for clearing doubt. Now question is... While using SQLite dll Version 3.3.4 on Windows - Multiple threads/processes access SQLite database, - Each thread does some SELECTs, INSERTs or UPDATEs. Wrapping all read-only SELECEs with BEGIN TRANSACTION and using BEGIN EXCLUSIVE to wrap all

Re: [sqlite] Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread RohitPatel9999
Thanks for the answer and clarification. > BEGIN IMMEDIATE blocks writers, not readers. I think, BEGIN IMMEDIATE surely blocks writers. And also blocks new reader(s) if any new reader tries to do BEGIN IMMEDIATE. Is this correct ? Ref: Quote from SQLite Document (http://www.sqlite.org/lang_

Re: [sqlite] Re: Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread RohitPatel9999
Thanks a lot for the answers. Still I have a doubt (and a question). Quote from SQLite Document (http://www.sqlite.org/lang_transaction.html) "After a BEGIN IMMEDIATE, you are guaranteed that no other thread or process will be able to write to the database or do a BEGIN IMMEDIATE or BEGIN EXCL

[sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread RohitPatel9999
Hi All, While using SQLite dll Version 3.3.4 on Windows - Multiple threads/processes access SQLite database, - Each thread does some SELECTs, INSERTs or UPDATEs. Scenario 1 If action of some user needs to execute multiple SELECT statements (read-only, no plan to write), it needs to start expli

[sqlite] RE: UNICODE Support

2006-08-03 Thread RohitPatel9999
Hi Dennis Volodomanov I am using SQLite 3.3.4. My Win32 Application needs international language support (Chinese, Japanese). I need my Win32 Application to build such that, MBCS defined for Windows 98/ME and UNICODE (and _UNICODE) defined for Windows NT/2000/2003/XP. Can you help me by givi

Re: [sqlite] INT and INTEGER are not same, behaves differently (for PRIMARY KEY) ?

2006-07-17 Thread RohitPatel9999
Thanks for the information. Reason I asked this was -> In my application, I need to use datatypes in create-table-statements such that same statements can work with different databases (MySQL, Oracle, PostgreSQL and SQL Server). I was refering the book -> SQL in a Nutshell, 2nd Edition, By Kevin

[sqlite] INT and INTEGER are not same, behaves differently (for PRIMARY KEY) ?

2006-07-12 Thread RohitPatel9999
INT and INTEGER behaves differently (for PRIMARY KEY) !!! (SQLite 3.3.4) create table t1 ( id INTEGER PRIMARY KEY ); create table t2 ( id INT PRIMARY KEY ); insert into t1 values(NULL); insert into t1 values(NULL); insert into t2 values(NULL); insert into t2 values(NULL); /* insert into t1 valu

Re: [sqlite] id INTEGER PRIMARY KEY vs PRIMARY KEY (id) ???

2006-07-12 Thread RohitPatel9999
Thank you very much for clearing my doubt. Rohit. -- View this message in context: http://www.nabble.com/id-INTEGER-PRIMARY-KEY--vs--PRIMARY-KEY-%28id%29-tf1922943.html#a5285302 Sent from the SQLite forum at Nabble.com.

[sqlite] id INTEGER PRIMARY KEY vs PRIMARY KEY (id) ???

2006-07-11 Thread RohitPatel9999
Hi SQLite users, In SQLite3 (3.3.4), Will both of the following statements create same tables ? 'id' column will be internally same or different ? create table t1 ( id INTEGER PRIMARY KEY, name CHAR(20) ); create table t1 ( id INTEGER, name CHAR(20), PRIMARY KEY (id) ); What I mea

[sqlite] Storage class and Affinity for BOOL/BOOLEAN, NUMBER, FLOAT, DOUBLE ?

2006-07-11 Thread RohitPatel9999
Hi SQLite Gurus, I have gone through online documentation of SQLite3 data types. I need to know (in SQLite 3.3.4), what will be the internal storage class and Column Affinity for columns defined in a table with BOOL/BOOLEAN, NUMBER, FLOAT and DOUBLE ? e.g. CREATE TABLE t1 ( bActive BOOL

Re: [sqlite] SQLite Vs VistaDB - Comparison ???

2006-07-10 Thread RohitPatel9999
[EMAIL PROTECTED] wrote: > > Process A wants to modify the database, so it flock()s > the rows it needs to changes and starts changing them. > But half way in the middle of the change, somebody sends > process A a SIGKILL and it dies. The OS automatically > releases the flocks as process A

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.

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 th

Re: [sqlite] Dumping Memory-DB to File

2006-06-25 Thread RohitPatel9999
Hi I need some help on this. I need to create a new SQLite database with all necessary tables, records and indices. 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 t

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

2006-06-25 Thread RohitPatel9999
Hi SQLite users, Questions: 1. What is the preferred way to copy/flush new memory db to disk db ? (all tables, indices, records from memoryDB to diskDB) 2. Should I create indices first in memory db or directly in disk db ? 3. How to maintain exclusive access to disk db file till creation/copying

Re: [sqlite] Locking

2006-06-16 Thread RohitPatel9999
FoxPro supports row level locking. Ofcourse FoxPro creates one file for each table. There must be some way to implement row level locking. Probable by locking region in a file or somehow. Just thinking curiously...how MS could have implemented row level locking in FoxPro. Rohit -- View this mes

Re: [sqlite] Row Locking

2006-06-16 Thread RohitPatel9999
FoxPro has Row Level locking. There must be some way with which it must have been implemented. Just curious...how MS would have implemented row level locking ??? Rohit -- View this message in context: http://www.nabble.com/Row-Locking-t69657.html#a4898759 Sent from the SQLite forum at Nabble.co

[sqlite] SQLite Vs VistaDB - Comparison ???

2006-06-16 Thread RohitPatel9999
Hello I was just comparing embedded SQL database engines (SQLite Vs VistaDB) for my knowledge. Itmight be of help for someone. In case, someone might be interested to know and/or add more feature comparisons. SQLite HomePage : www.sqlite.org More Features : www.sqlite.org, www.sqlite.org/docs.

[sqlite] Two instances of app access same db, one instance hangs or killed

2006-06-16 Thread RohitPatel9999
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= * Multiple instances of application can be started at the same time * * For example two instances of application are running * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= An Win32 Ap

Re: [sqlite] Avoiding Fragmentation of SQLite database file ???

2006-06-14 Thread RohitPatel9999
> SQLite seeks to keep its database file size minimized. > I think that SQLite should by default continue to follow > its current strategy of minimizing file size. But I > am not adverse to adding a PRAGMA that will put the > database into a different "preallocation" mode where > the databas

Re: [sqlite] Avoiding Fragmentation of SQLite database file ???

2006-06-14 Thread RohitPatel9999
Thanks for prompt reply. Agreed. SQLite needs zero-configuration. But applications using multiple SQLite database files for read and write, makes those files with many-many fragments in disk. Which definitely degrades database file read/write performance tremendously. Any solution to that (w

Re: [sqlite] Avoiding Fragmentation of SQLite database file ???

2006-06-14 Thread RohitPatel9999
I know and have used deframentation apps. Thats good. But why to force end-users to defragment their disk. SQLite manages free-space in file very-well (after deleting records). So I also created one template database file with optimum number of records, then deleted records and copied that file

[sqlite] Avoiding Fragmentation of SQLite database file ???

2006-06-13 Thread RohitPatel9999
Hi SQLiteUsers Developing MFC Application (Small Business Accounting Application) (developed using Visual Studio) - App will run on Windows 98/2000 - App uses SQLite database files for storage of data - It will have one database for each company accounts/info. So if accounts of 10 companies, th

[sqlite] Which is most appropriate encoding ?

2006-06-13 Thread RohitPatel9999
Hi SQLiteUsers, Need some guidance. While developing Win32/MFC Application (with Visual C++ 6.0) - Application uses SQLite DB for it's data storage - Application must run on most windows (Windows 98, ME, NT, XP, 2000) - User should be able to copy Database from one PC to another PC (one PC may