Re: Export and Import SQLite data from LC Project?

2011-10-25 Thread Mark Schonewille
Hi John,

Can't you transfer the entire database file? If not, you can just do a dump and 
import the resulting file or do a query and save the data to a text file, which 
you import the usual way.

--
Best regards,

Mark Schonewille

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

Become our partner in sales http://qery.us/16r Start selling Color Converter 
today. 20% commission!

On 25 okt 2011, at 21:27, John Patten wrote:

 Hi All…
 
 Is it possible to export data from SQLite database, save it as a file, and 
 then import it back into the same database?
 
 I'm looking for a way to allow users of a LC project to save out their data 
 in the SQLite database and then sneaker-net it on another machine using the 
 same LC application and import into that app's SQLite database. 
 
 Is there some SQLite statement that creates a query that I then can have LC 
 save out as a file, and then do the reverse, and import it and run the query 
 on the second machine?
 
 Thank you!
 
 John Patten
 SUSD


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Export and Import SQLite data from LC Project?

2011-10-25 Thread Pete
I don't think there's a built in way to do this in LC, you'd have to write
some code.

Alternatively, if you have sqlite3 on your computer, you could run it from
LC and pass it the necessary commands to dump and restore the db.  To dump
the data, You'd need to send it a .mode command with a mode of insert ( to
create SQL Insert statements), then a .dump command.  To add it back, use
the sqlite3 .read command.  Run sqlite3 and enter .help for more specific
info.

All that assumes the table you are loading data into doesn't already have
the dumped data in it.

Pete
Molly's Revenge http://www.mollysrevenge.com




On Tue, Oct 25, 2011 at 12:27 PM, John Patten johnpat...@mac.com wrote:

 Hi All…

 Is it possible to export data from SQLite database, save it as a file, and
 then import it back into the same database?

 I'm looking for a way to allow users of a LC project to save out their data
 in the SQLite database and then sneaker-net it on another machine using the
 same LC application and import into that app's SQLite database.

 Is there some SQLite statement that creates a query that I then can have LC
 save out as a file, and then do the reverse, and import it and run the query
 on the second machine?

 Thank you!

 John Patten
 SUSD
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Export and Import SQLite data from LC Project?

2011-10-25 Thread Warren Samples

On 10/25/2011 02:34 PM, Mark Schonewille wrote:

Hi John,

Can't you transfer the entire database file? If not, you can just do a dump and 
import the resulting file or do a query and save the data to a text file, which 
you import the usual way.

--
Best regards,

Mark Schonewille




Mark is correct. This is from the Distinctive Features page provided 
by SQLite:


Single Database File
 An SQLite database is a single ordinary disk file that can be located 
anywhere in the directory hierarchy. If SQLite can read the disk file 
then it can read anything in the database. If the disk file and its 
directory are writable, then SQLite can change anything in the database. 
Database files can easily be copied onto a USB memory stick or emailed 
for sharing.


Stable Cross-Platform Database File
 The SQLite file format is cross-platform. A database file written on 
one machine can be copied to and used on a different machine with a 
different architecture. Big-endian or little-endian, 32-bit or 64-bit 
does not matter. All machines use the same file format. Furthermore, the 
developers have pledged to keep the file format stable and backwards 
compatible, so newer versions of SQLite can read and write older 
database files.


You don't need to do anything other than copy the database file.

Warren

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode