Re: [sqlite] Error message "database disk image is malformed"

2008-11-17 Thread Ernany
Hello,

Problem:  Exception message: The database disk image is malformed.

Is it possible recuver my database?

I need to copy my tableto other table.

With SQLite Expert Personal 1.7.49,I can not see a table.
With SQLite Database Browser 1.3 , I can see all tables.

Someone help me

Thanks,

Ernany


2008/11/17 Joanne Pham <[EMAIL PROTECTED]>

> Hi All,
> Suddenly on my server whenever I login to the database using the following
> command:
> sqlite3 myDB
> and
> run the .schema I got the error message return back:
> "Error: database disk image is malformed"
> What is this problem and how to fix it.
> Thanks in advance for your help.
> Thanks,
> Joanne
>
>
>
>
>
> 
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Error message "database disk image is malformed"

2008-11-17 Thread Joanne Pham
Hi All,
Suddenly on my server whenever I login to the database using the following 
command:
sqlite3 myDB
and
run the .schema I got the error message return back:
"Error: database disk image is malformed"
What is this problem and how to fix it.
Thanks in advance for your help.
Thanks,
Joanne

 




> ___
> 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] Recovery program

2008-11-17 Thread John Stanton
Since an Sqlite database is a single file taking a snapshot backup is 
very simple and rapid.  You could maintain an almost current image at 
all times that way.  Complete recovery could be possible by modifying 
Sqlite oryour application to keep a journal of SQL statements processed 
between snapshot backups.

A better strategy would be to ensure that you used a reliable server. 
We have never had a corrupted Sqlite database on our Linux or AIX aervers.
JS

raf wrote:
> Roger Binns wrote:
> 
> 
>>raf wrote:
>>
>>>i also needed the ability to restore an sqlite3 database
>>>after a corruption.
>>
>>What exactly are you doing that corrupts the database in the first
>>place?  If the machine you are using is randomly corrupting data then
>>having your own journal won't help that much!
>>
>>If you are doing things like turning synchronous off then it is easier
>>to have two database files (use ATTACH).  Have one be the defaults (ie
>>correctness, no corruption) at the expense of speed and the second be
>>turned for speed at the expense of possible corruption.  You can copy
>>the data back and forth as necessary.
>>
>>Roger
> 
> 
> i've never turned off synchronous. i set up my recovery
> mechanism on the grounds that corruption is possible and i
> wanted the website to heal itself should it ever happen.
> 
> i've only ever had one real corruption (as reported by
> pragma integrity_check). i have no idea what caused it but
> it was nothing mentioned in the how to avoid corruption
> document. however, because the .dump command doesn't report
> errors, i had been interpreting its many failures to
> function correctly as a sign of corruption. this was a
> mistake on my part but one that was easy to make since i was
> also receiving "malformed disk image" error messages from
> the website at the same time. it turned out that these
> messages always coincided with database recovery (i.e. it
> didn't preceed them) and so were presumably signs of the
> database being rebuilt after a false corruption 'detection'.
> 
> the .dump failures were just due to the database being busy.
> i now retry .dumps when its output is abnormally short
> and it's very much better.
> 
> however, i will keep the recovery system in place because,
> as i said, there has been one real corruption, and it might
> happen again and the recovery system works very well.
> 
> cheers,
> raf
> 
> ___
> 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] Recovery program

2008-11-17 Thread raf
Roger Binns wrote:

> raf wrote:
> > i also needed the ability to restore an sqlite3 database
> > after a corruption.
> 
> What exactly are you doing that corrupts the database in the first
> place?  If the machine you are using is randomly corrupting data then
> having your own journal won't help that much!
> 
> If you are doing things like turning synchronous off then it is easier
> to have two database files (use ATTACH).  Have one be the defaults (ie
> correctness, no corruption) at the expense of speed and the second be
> turned for speed at the expense of possible corruption.  You can copy
> the data back and forth as necessary.
> 
> Roger

i've never turned off synchronous. i set up my recovery
mechanism on the grounds that corruption is possible and i
wanted the website to heal itself should it ever happen.

i've only ever had one real corruption (as reported by
pragma integrity_check). i have no idea what caused it but
it was nothing mentioned in the how to avoid corruption
document. however, because the .dump command doesn't report
errors, i had been interpreting its many failures to
function correctly as a sign of corruption. this was a
mistake on my part but one that was easy to make since i was
also receiving "malformed disk image" error messages from
the website at the same time. it turned out that these
messages always coincided with database recovery (i.e. it
didn't preceed them) and so were presumably signs of the
database being rebuilt after a false corruption 'detection'.

the .dump failures were just due to the database being busy.
i now retry .dumps when its output is abnormally short
and it's very much better.

however, i will keep the recovery system in place because,
as i said, there has been one real corruption, and it might
happen again and the recovery system works very well.

cheers,
raf

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


[sqlite] request for enhancement - select vfs via syntax extension

2008-11-17 Thread Gifford Hesketh
I would like to be able to select which vfs to use with the ATTACH
DATABASE command, similar to what is possible with sqlite3_open_v2().
A PRAGMA statement might be the easiest to implement, but extending
the ATTACH DATABASE seems more elegant.

I was thinking of either:
 ATTACH DATABASE 'file.db' AS alias USING 'vfs_name'
or
 ATTACH DATABASE 'file.db' AS alias WITH vfs = 'vfs_name'

It might also be nice to be able to use the latter syntax for
additional per-database settings, e.g. locking_mode, journal_mode,
etc.


I hope this is a useful suggestion.

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


Re: [sqlite] Dropping and creating indexes

2008-11-17 Thread Igor Tandetnik
"Hugh Gibson" <[EMAIL PROTECTED]> wrote
in message news:[EMAIL PROTECTED]
> I see from the syntax of DROP INDEX that a table name is not
> specified. Are there any plans for adding a way of specifying the
> table?
>
> I note that SQLite prevents creation of indexes with the same name,
> regardless of table.

Quite. So it's unclear why you would want to be able to mention table 
name in the DROP INDEX statement.

> Also, is there any good reason for creating a primary key versus
> creating a separate index afterwards?

INTEGER PRIMARY KEY column has a special meaning in SQLite:

http://sqlite.org/autoinc.html

Other than this one special case, a PRIMARY KEY is implemented 
internally simply by creating an index. Functionally, making a column 
(or a group of columns) PRIMARY KEY or UNIQUE has the same effect as 
creating a UNIQUE index on the same columns.

Igor Tandetnik 



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


Re: [sqlite] Trigger commands don't update "new" record?

2008-11-17 Thread Chris Eich
[Apparently I don't get my own postings to this list?]

Anyway, I have an improvement to my trigger that eliminates the SELECT's for
event_id: two triggers! Comments welcome.

-- First set the SET's correlation id when a CLR is inserted
CREATE TRIGGER set_event_correlation_id_on_insert
AFTER INSERT ON device_event
WHEN new.event_state = 1
BEGIN
UPDATE device_event SET event_correlation_id = new.event_id
WHERE device_id = new.device_id
  AND event_code = new.event_code
  AND event_state = 2
  AND event_correlation_id IS NULL
ORDER BY event_date DESC LIMIT 1;
END;

-- Then trigger on that SET's update to set the CLR's correlation id
CREATE TRIGGER set_event_correlation_id_on_update
AFTER UPDATE OF event_correlation_id ON device_event
WHEN new.event_state = 2
 AND new.event_correlation_id IS NOT NULL
BEGIN
UPDATE device_event SET event_correlation_id = new.event_id
WHERE event_id = new.event_correlation_id;
END;

Chris

On Mon, Nov 17, 2008 at 9:11 AM, Chris Eich <[EMAIL PROTECTED]> wrote:

> [Sorry if you see this twice; I sent it yesterday and see it in the
> archives, but never got it in my inbox. --Chris]
>
>
> On Sun, Nov 16, 2008 at 12:59 PM, Chris Eich <[EMAIL PROTECTED]> wrote:
>
>> I have an events table where SET events for a given device_id and
>> event_code are followed by CLR events.
>>
>> CREATE TABLE device_event (
>> event_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
>> device_id INTEGER NOT NULL REFERENCES device,
>> event_date INTEGER NOT NULL,
>> event_code INTEGER NOT NULL REFERENCES event_code,
>> event_state INTEGER NOT NULL REFERENCES event_state,
>> event_text TEXT,
>> exported INTEGER DEFAULT 0,
>> created_date INTEGER NOT NULL,
>> event_correlation_id INTEGER
>> );
>>
>> I want to set event_correlation_id when a CLR is inserted, so that the
>> SET and CLR events reference each other.
>>
>> CREATE TRIGGER update_event_correlation_id AFTER INSERT ON device_event
>> WHEN new.event_state = 1
>> BEGIN
>> UPDATE device_event SET event_correlation_id = (
>> SELECT event_id FROM device_event
>> WHERE device_id = new.device_id
>>   AND event_code = new.event_code
>>   AND event_state = 2
>> ORDER BY event_date DESC LIMIT 1
>> ) WHERE event_id = new.event_id;
>> UPDATE device_event SET event_correlation_id = new.event_id
>> WHERE event_id = new.event_correlation_id;
>> END;
>>
>> My first version of this trigger failed entirely when I omitted the AFTER
>> keyword. I wish the default *trigger-time* were documented.
>>
>> The second UPDATE in the trigger still fails, though; it seems that the
>> new record does not get modified by the first UPDATE. If this is true,
>> perhaps it could also be documented.
>>
>> I ended up having to run the SELECT a second time to make the second
>> UPDATE work:
>>
>> CREATE TRIGGER update_event_correlation_id AFTER INSERT ON device_event
>>  WHEN new.event_state = 1
>> BEGIN
>> UPDATE device_event SET event_correlation_id = (
>> SELECT event_id FROM device_event
>> WHERE device_id = new.device_id
>>   AND event_code = new.event_code
>>   AND event_state = 2
>> ORDER BY event_date DESC LIMIT 1
>> ) WHERE event_id = new.event_id;
>> UPDATE device_event SET event_correlation_id = new.event_id
>> WHERE event_id = (
>> SELECT event_id FROM device_event
>> WHERE device_id = new.device_id
>>   AND event_code = new.event_code
>>   AND event_state = 2
>> ORDER BY event_date DESC LIMIT 1
>> );
>> END;
>>
>> I am afraid this will get too slow, and can do without the second update
>> (setting event_correlation_id for the earlier SET event), but I would like
>> to know if there's a more efficient way to do both.
>>
>> Chris
>>
>>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Escaped values throws error

2008-11-17 Thread John Stanton
It is particularly valuable to use bound values when you have WWW access 
so that you block the possibility of SQL injection attacks.

Eric Minbiole wrote:
>>This is my first foree into PDO-SQLite and I saw samples using binding,
>>I am using prepare() though without binding.
>>
>>So you think that had I used binding my escape issue would not be an issue ?
> 
> 
> Correct.  Though I've not used PDO-SQLite (I use the C interface), I 
> would think that using bound parameters would eliminate your string 
> escaping issues.  I use bound parameters almost exclusively:  You never 
> have to worry about escaping or sanitizing your strings-- just let the 
> Db engine do the work for you.
> 
> A related classic: http://xkcd.com/327/
> 
> ~Eric
> ___
> 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] OLE DB provider for SQLite

2008-11-17 Thread Brad Stiles
> The problem with performance is not caused directly by SQLite provider, but 
> by different
> way of reading data from managed (ADO.NET) providers by Analysis Services.

Ah.  "Analysis Services".  'Nuff said.  Missed that the first time around. :)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] OLE DB provider for SQLite

2008-11-17 Thread Marcin Walkowiak
-Original Message-
Date: Mon, 17 Nov 2008 08:53:44 -0500
From: "Brad Stiles" <[EMAIL PROTECTED]>
Subject: Re: [sqlite] OLE DB provider for SQLite
To: "General Discussion of SQLite Database" 
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

>> PS Managed (ADO.NET) providers do not satisfy requirements for
>> performance reasons.

> That's a pretty blanket statement.  I've found Robert Simpson's
> ADO.NET provider to be very performant.  He has a benchmarking suite
> he wrote to compare various DBs.  It might still be available for
> download.

The problem with performance is not caused directly by SQLite provider, but by 
different way of reading data from managed (ADO.NET) providers by Analysis 
Services.

I know managed SQLite providers (like System.Data.SQLite) well, and I know that 
they are fast. I've tested performance of them. But in this case the difference 
between OLE DB providers and ADO.NET providers is great. For example when we 
underline MSSQL provider for SSAS:

ADO.NET (System.Data.SQLClient): 114 sec
OLE DB (SQLNCLI.1): 23 sec

This performance problem IS NOT restricted to SQLite provider, it occurs in all 
ADO.NET providers I've tested.

KoD


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


Re: [sqlite] Trigger commands don't update "new" record?

2008-11-17 Thread Chris Eich
[Sorry if you see this twice; I sent it yesterday and see it in the
archives, but never got it in my inbox. --Chris]

On Sun, Nov 16, 2008 at 12:59 PM, Chris Eich <[EMAIL PROTECTED]> wrote:

> I have an events table where SET events for a given device_id and
> event_code are followed by CLR events.
>
> CREATE TABLE device_event (
> event_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
> device_id INTEGER NOT NULL REFERENCES device,
> event_date INTEGER NOT NULL,
> event_code INTEGER NOT NULL REFERENCES event_code,
> event_state INTEGER NOT NULL REFERENCES event_state,
> event_text TEXT,
> exported INTEGER DEFAULT 0,
> created_date INTEGER NOT NULL,
> event_correlation_id INTEGER
> );
>
> I want to set event_correlation_id when a CLR is inserted, so that the SET
> and CLR events reference each other.
>
> CREATE TRIGGER update_event_correlation_id AFTER INSERT ON device_event
> WHEN new.event_state = 1
> BEGIN
> UPDATE device_event SET event_correlation_id = (
> SELECT event_id FROM device_event
> WHERE device_id = new.device_id
>   AND event_code = new.event_code
>   AND event_state = 2
> ORDER BY event_date DESC LIMIT 1
> ) WHERE event_id = new.event_id;
> UPDATE device_event SET event_correlation_id = new.event_id
> WHERE event_id = new.event_correlation_id;
> END;
>
> My first version of this trigger failed entirely when I omitted the AFTER
> keyword. I wish the default *trigger-time* were documented.
>
> The second UPDATE in the trigger still fails, though; it seems that the
> new record does not get modified by the first UPDATE. If this is true,
> perhaps it could also be documented.
>
> I ended up having to run the SELECT a second time to make the second UPDATE
> work:
>
> CREATE TRIGGER update_event_correlation_id AFTER INSERT ON device_event
>  WHEN new.event_state = 1
> BEGIN
> UPDATE device_event SET event_correlation_id = (
> SELECT event_id FROM device_event
> WHERE device_id = new.device_id
>   AND event_code = new.event_code
>   AND event_state = 2
> ORDER BY event_date DESC LIMIT 1
> ) WHERE event_id = new.event_id;
> UPDATE device_event SET event_correlation_id = new.event_id
> WHERE event_id = (
> SELECT event_id FROM device_event
> WHERE device_id = new.device_id
>   AND event_code = new.event_code
>   AND event_state = 2
> ORDER BY event_date DESC LIMIT 1
> );
> END;
>
> I am afraid this will get too slow, and can do without the second update
> (setting event_correlation_id for the earlier SET event), but I would like
> to know if there's a more efficient way to do both.
>
> Chris
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] OLE DB provider for SQLite

2008-11-17 Thread Robert Simpson
Agreed.  There may be some scenarios in which the C interface or some
C++/OLEDB interface to SQLite outperforms the ADO.NET provider significantly
-- but in most cases there is only a negligible performance impact that can
only be measured through thousands of iterations.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brad Stiles
Sent: Monday, November 17, 2008 6:54 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] OLE DB provider for SQLite

> PS Managed (ADO.NET) providers do not satisfy requirements for
> performance reasons.

That's a pretty blanket statement.  I've found Robert Simpson's
ADO.NET provider to be very performant.  He has a benchmarking suite
he wrote to compare various DBs.  It might still be available for
download.

http://sqlite.phxsoftware.com/forums/t/174.aspx (Desktop)
http://sqlite.phxsoftware.com/forums/t/175.aspx (Mobile)
http://sqlite.phxsoftware.com/forums/p/17/33.aspx#33 (Comparing C# to C++)
___
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] OLE DB provider for SQLite

2008-11-17 Thread Brad Stiles
> PS Managed (ADO.NET) providers do not satisfy requirements for
> performance reasons.

That's a pretty blanket statement.  I've found Robert Simpson's
ADO.NET provider to be very performant.  He has a benchmarking suite
he wrote to compare various DBs.  It might still be available for
download.

http://sqlite.phxsoftware.com/forums/t/174.aspx (Desktop)
http://sqlite.phxsoftware.com/forums/t/175.aspx (Mobile)
http://sqlite.phxsoftware.com/forums/p/17/33.aspx#33 (Comparing C# to C++)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Dropping and creating indexes

2008-11-17 Thread Hugh Gibson

We implement automatic instructions to upgrade a database schema. These
include modifying field values and adding/dropping fields, tables,
indexes etc.

I see from the syntax of DROP INDEX that a table name is not specified.
Are there any plans for adding a way of specifying the table?

There are various syntaxes at http://www.w3schools.com/SQL/sql_drop.asp -


DROP INDEX index_name ON table_name 
DROP INDEX table_name.index_name
ALTER TABLE table_name DROP INDEX index_name

Given the existing syntax of "DROP INDEX index_name" the first format
would seem to be most useful.

I note that SQLite prevents creation of indexes with the same name,
regardless of table.


Also, is there any good reason for creating a primary key versus creating
a separate index afterwards? Primary keys can't be deleted so if I have
to modify one, the complete table has to be dropped and re-created,
including copying all the data.

If, for example, I had a compound index on multiple fields and made it
the primary key, or had a text field as the primary key,
http://www.sqlite.org/lang_createtable.html says that an automatically
generated integer will be used as the B-tree key. So in this case it
would appear that the primary key has no special function. Am I missing
something here? Why can't they be dropped? (To test this I used
SqliteExplorer and accessed the default name of the primary key index,
and tried to drop that.)

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


[sqlite] OLE DB provider for SQLite

2008-11-17 Thread Marcin Walkowiak (Work-Local Account)
Is there any OLE DB provider for SQLite other than provider from Cherry 
City Software:

http://cherrycitysoftware.com/ccs/Providers/ProvSQLite.aspx

Unfortunately this provider does not work well with one of my company's 
project (it must with Analysis Services and OLAP).

Could You tell me, are there another OLE DB providers?


PS Managed (ADO.NET) providers do not satisfy requirements for 
performance reasons.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Setbusytimeout(int nMillisec)

2008-11-17 Thread Igor Tandetnik
"Satish" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
>   Can anyone tell me what setbusytimout function will do.

http://sqlite.org/c3ref/busy_timeout.html

Igor Tandetnik 



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


[sqlite] Setbusytimeout(int nMillisec)

2008-11-17 Thread Satish
Hi



   Can anyone tell me what setbusytimout function will do.if it locks
database its not happening.i had opened the same database with two objects
before opening the database with second object I set setime out value to
2000msec even though database is opened using the second object

 

Regards,

Satish.G

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


Re: [sqlite] INTEGER PRIMARY KEY and triggers

2008-11-17 Thread Hugh Gibson
> I am addicted to using INTEGER PRIMARY KEY AUTOINCREMENT as the id  
> fields in my SQLite projects, yet I would like to try some triggers 
> as  well.  Of course, every time I add a trigger that accesses a 
> table  with  these types of id fields, all sorts of odd things 
> happen.

Not to mention the fact that an index made up of 2 or more fields
including the id field won't be used correctly. See
http://www.sqlite.org/cvstrac/tktview?tn=1893

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


Re: [sqlite] Comparing a field between two databases?

2008-11-17 Thread Gilles Ganault
On Mon, 17 Nov 2008 10:39:17 +0100, Gilles Ganault
<[EMAIL PROTECTED]> wrote:
>.attach db1.sqlite
>.attach db2.sqlite

Correction:

attach "db1.sqlite" as db1
attach "db2.sqlite" as db2

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


Re: [sqlite] Comparing a field between two databases?

2008-11-17 Thread Gilles Ganault
On Sun, 16 Nov 2008 18:28:50 +0900, "Alexandre Courbot"
<[EMAIL PROTECTED]> wrote:
>attach is probably what you want:

Thanks. For those interested, here's how to load two database files
into the sqlite3.exe CLI, and retrieve rows that have a common "code"
value in two tables:

C:\> sqlite3.exe

.attach db1.sqlite
.attach db2.sqlite

SELECT 'db1',db1.table1.mycol1,'db2',db2.table1.mycol1 FROM
db1.table1,db2.table1 WHERE db1.table1.code=db2.table1.code;

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


[sqlite] Problem : "The database disk image is malformed"

2008-11-17 Thread Ernany
Hello,

Problem:  Exception message: The database disk image is malformed.

Is it possible recuver my database?

I need to copy my tableto other table.

With SQLite Expert Personal 1.7.49,I can not see a table.
With SQLite Database Browser 1.3 , I can see all tables.

Someone help me

Thanks,

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


Re: [sqlite] Sqlite3Explorer Sqlite Report Designer

2008-11-17 Thread Rajesh Nair
Dear Cariotoglou Mike,

I am using VC++ for last 6 years to develop utilities and some small
projects. Formerly I was using MS-ACCESS and/or some database classes in my
projects. Once I felt the power of sqlite I started using it from 2003 /
2004. After that I have not used any ADO / ODBC for my databases. I have
felt the easyness of the moto "NO CONFIGURATION" of sqlite. I have developed
some very use full VC++ classes to handle the sqlite database file. I was
producing reports with my-own list-view control. Now some simple formated
reports are developed but if any changes in the report will result a total
EXE replace. That's why I am trying some external utility that could support
my EXE to produce simple formated reports.
I noticed that your DLL can open some FR3 or some FRF extention files.

THE NEED IS THAT REPORT FORMAT WILL BE SAVED AS AN EXTERNAL FILE OF THE
FORMAT THAT YOUR DLL CAN READ AND ALLIGN THE REPORT-VIEWER WINDOW FOR
PRINTING.

The dataset that you specified can be XML or sqlite database itself. If you
are planning to find some time to support sqlite ( as you found some time to
develop the Sqlite3Explorer ) then please keep some points in mind while
rebuilding the DLL.

   1) The dll can be used for both DESIGNING and PRE-VIEWING.
   2) The dll can be used to either DESIGNING or PRE-VIEWING
according to
   some parameters passed in to it. ( ie. If the HOST EXE needs
only pre-viewing the
   report then the DESIGNER window must not appear. The designer
mode will
   be shown on demand specified by a param passed to the DLL)

If I get such a DLL then I will be using the same for my further projects
and will also gradualy replace the method that I was using to show-report.
If some others those who are using sqlite with VC++ / VB or some other WIN32
platform programs may try to use it.

Thanks
Rajesh Nair


On Mon, Nov 17, 2008 at 5:18 AM, Cariotoglou Mike <[EMAIL PROTECTED]> wrote:

> here is an idea : I might be able to modify the dll to accept datasets in a
> different, "standard" format, like XML.
> this would imply that your product would need to retrieve data in whatever
> format it needs, transform it to my format,
> pass it to the dll which will do the design and reporting. it will not as
> fast as it is now, but it is definately a solution. you would not have the
> source of the dll, but you could use it freely, no IR issues.
>
> for this to work , the following assumptions must prove correct:
>
> 1. I originally designed the DLL with portability in mind, so it *coul* be
> transformed as I described. since that time, otuehr developers have improved
> it. I need to check that they have not introduced dependencies and design
> decisions that would nullify its portability.
>
> 2. that you (or somebody else) actually would benefit from this approach.
> f.e do you *like* the report designer (as seen and used from
> sqlite3Explorer), or is it just something you came across and thought to
> give a try?
>
> I only point this out, because it will take me at least 10-20 hours to do
> this conversion, and it would be a big waste of time (mine) to do this just
> as an intellectual exercise. I am not asking for financial compensation
> here, just to know that I am actually doing something useful...
>
>
> PS another format that would work, besides XML, and that I already have a
> lot of code to support would be the ADO recordset. is this an option for you
> ? what language are you planning to use in order to host the DLL, and what
> database ?
>
>
> 
>
> From: [EMAIL PROTECTED] on behalf of Rajesh Nair
> Sent: Sat 15/11/2008 5:53 AM
> To: General Discussion of SQLite Database
>  Subject: Re: [sqlite] Sqlite3Explorer Sqlite Report Designer
>
>
>
> Thanks
>
> So I can't use it... Ok ... But I got some source code of  FastReport (
> some
> ealier version ) from the internet and it is in Dephi/Pascal. I don't know
> both of the tools. Can you use the same code to build a dll which can be
> used with other windows programing languages? ( So that no one can raise
> their finger aganist me or YOU ).
>
> I don't want a very efficient-high-end report designer like FastReport. My
> clients require very simple reports, which does not contain much
> caculations
> etc If you can help me  please. It won't be just for me. Those who are
> using SqLite with windows will be happy with a simple report deisgner and
> viewer. Also my company is not willing to puchase any product for just
> reporting, since our programs are supplied freely along with some of our
> products. So an extra cost is not feasible.
>
> A SIMPLE DISIGNER/VIEWER FOR WINDOWS USERS
>
>
> - Original Message -
> From: "Cariotoglou Mike" <[EMAIL PROTECTED]>
> To: "General Discussion of SQLite Database" 
> Sent: Friday, November 14, 2008 7:14 PM
> Subject: Re: [sqlite] Sqlite3Explorer Sqlite Report Designer
>
>
> >I am the author of