Programming :: Load Multiple Records Into SQLite?
Nov 19, 2008
I am using SQLite as my database for some portable cross platform applications I am working on with REALBasic as my IDE. I have an old Sybase 8.0 database that I can access via Microsoft Access and thereby extract the data I need from each table.
Now I know I can create .csv files from each table and load them into SQLite using the import tool, but then I can't define the primary key and other field attributes. So the other option is to load each file via SQL.
Now with most SQL editors I can create multiple queries and they will run just fine. But I can't seem to do that with the SQLite interfaces. I can paste multiple queries but I can only run one at a time. And by that I mean I have to click run.
Ummm that's not acceptable since my biggest table contains over 600,000 records. I have the queries all written, that was easy using a simple interface I wrote in Access.
Code:
INSERT INTO tblMeters(recordId,meterId,meterName,meterSerNum,registerSerNum,mxuSerNum,meterType,manufacture,meterModel,readType,groupId,multiplier,rollover,vendorId,xfrmerCode,bldgCode,CATEGORY,energyType,unitOfMeasure,location,access,comments,dateInstalled,dateCalibrate,pipeSizeIn,pipeSizeOut,elecMeterSpecs)
[Code]...
So is there another method I can use? I can't seem to find anything relating to my particular question at the SQLite web site
View 3 Replies
ADVERTISEMENT
May 23, 2010
I have some big sqlite3 databases in ~/.mozilla/firefox/profilename Notably places.sqlite (12 MB) and urlclassifier3.sqlite (33 MB). Is it possible to truncate them and wipe out the oldest records in them? Of course I could just wipe them completely, but that's not my goal - I just want to minimize the size of those files while keeping the newest records.
View 2 Replies
View Related
Jun 10, 2010
Anyone know how to execute SQLite db commands from C++?
View 1 Replies
View Related
Jun 15, 2010
I have the following TCL code:
if{ [catch {sqlite3 db /path/to/db/file} result] } {
puts stderr $result
} else {
do something
}
What I want is to use a variable for the file name/path. When I put in a variable instead of the absolute path, I get an error: "missing close-brace: possible unbalanced brace in comment while executing"
This is weird because when I run the code with the fully qualified pathname, it works fine. I substitute out the pathname for a variable containing the pathname ($variable) and I get this error.
View 1 Replies
View Related
Apr 8, 2010
I'm sure I'm missing something pretty obvious, but I can't for the life of me stop my pysqlite scripts crashing out with a database is locked error. I have two scripts, one to load data into the database, and one to read data out, but both will frequently, and instantly, crash depending on what the other is doing with the database at any given time.I've got the timeout on both scripts set to 30 seconds: cx = sqlite.connect("database.sql", timeout=30.0)and think I can see some evidence of the timeouts in that i get what appears to be a timing stamp (e.g 0.12343827e10 1) dumped occasionally in the middle of my curses formatted output screen, but no delay that ever gets remotely near the 30 second timeout, but still one of the other keeps crashing again and again from this. I'm running RHEL5.4 on a 64 bit HS21 IBM blade, and have heard some mention about issues about multi-threading and am not sure if this might be relevant.
Packages in use are sqlite-3.3.6-5 and python-sqlite-1.1.7-1.2.1, and upgrading to newer versions outside of RedHat's official provisions is not a great option for me. Possible, but not desirable due to the environment in general.I have had autocommit=1 on previously on both scripts, but have since disabled on both, and am now cx.commit()ing on the inserting script and not committing on the select script. Ultimately as I only ever have one script actually making any modifications, I don't really see why this locking should ever ever happen
View 3 Replies
View Related
Jun 9, 2010
I am using C++ with SQLite db in a program that will read read a sub set of records, compare records and write different records to another database. I have a SQLite book, but it only shows examples for the C API. Anyone have code samples in C++ for the following:
Open database
Close
Select *
Read
Write
Or, just show me how to execute a SQL statement with C++ and I can then figure out the various SQL statements I need.
View 5 Replies
View Related
Apr 23, 2011
I want to loop through the records in the below file (homedir.temp)
/home/user1
/home/user2
/home/user3
I want to do the following activities with each record1. du -s - to get the total usage for that directory (my variable name is SIZE)2. divide SIZE by du -c for /home to get the percentage of usage. (my variable name is PER)3. write the directory, SIZE, PER to a filePROBLEMI am using the below for loop: for record in homedir.tempthe mentioned activitiesdonehe above is not looping through the records. It does the first record perfectly and exits the loop.
View 14 Replies
View Related
Nov 17, 2010
I have to parse a file containing billions of records and populate them in the Data structure. I have used a lot of C++ class and creating objects of the class I am storing the information retrieved by parsing the file.
Now as the file become huge and number of objects become very large my code is getting bad_alloc error as it is not finding any space avalable in the heap for allocating new object.
Is there any way to parse the file?
View 7 Replies
View Related
Dec 31, 2010
i am trying this query to compare records of two different tables...i m geting this message!! no required out putvalues for these ($jobTitle $industry $stationBase $gender $maritalStatus)are coming from textboxes!here is the code...
PHP Code:
$query = "(SELECT *,
MATCH(industry, gender, maritalStatus , typeofWorkPosition , preferCity) AGAINST ('$
[code]....
View 4 Replies
View Related
Oct 23, 2010
I'm using MYTHTV with AT&T's U-Verse system. AT&T apparently turns off the set-top box if the box doesn't receive any commands after some number of hours. When this happens the box takes so long to turn on that it doesn't process the lirc IR channel change command. I've rewritten my channel changer to add a lockfile, and added a cron entry to kick off an entry to just "ping" the set-top box once an hour. But, OK, I'd like to play the bandwidth saving game and not do this if there isn't anything in the "record" table.
So, how would I write a script that will check the number of rows in the "record" table in the "mythconverg" database and exit if there are zero rows? I'm afraid I don't know how to even start this. Here is my "keepalive.sh" script that does the pinging:
Code:
#!/bin/sh
#if there are no rows in the record table, just exit this script
# lock the lockfile - MUST be same one as channel lock
while [ `lockfile "/tmp/mythchanlock.lck"` ]
[Code]....
View 3 Replies
View Related
Jan 4, 2010
I am going to parse the Cisco voip CDR(Call Detail Records), please tell me the field format of the CDR files.
View 1 Replies
View Related
Jul 28, 2010
I have two files :
FileA
prot1
prot5
prot9
prot15
[Code]....
What I need to do is to extract from fileB the fields containing only the strings in fileA.
I thought awk could do the job easily with :
Code:
awk 'BEGIN { RS = "###" } /'$variable'/' fileB > output
where variable would maybe be the output of grep from fileA. So can I store the output of grep in a variable to use it afterwards with awk ?
something like that:
Code:
result=`grep prot. fileA` ; awk 'BEGIN { RS = "###" } /'$result'/' fileB > output
but that doesn't work. I'm always getting the entire fileB.
The output of grep get stored in the variable, I verified that with echo. So there is something that I just don't get... It seems to me that the above line should work.
View 11 Replies
View Related
Aug 9, 2011
I have a box currently setup to share files on my network and for the most part its great. However when multiple people request files my 1gb speeds drop. I have extra 1gb NIC's to use but have no clue on how to spread the load of transfering files between multiple nics. Is this even possible? or does this happen automagically?
View 2 Replies
View Related
May 4, 2010
some users [ possibly ATI card owners running fglrx default ubuntu driver ] have issues having compiz enabled and trying to change the mouse pointer to a larger size. It actually doesn't get resized at all, expect when moved over Firefox and OpenOffice.I was fiddling in trying to get a workaround for this when suddenly Nautilus started to crash and respawn in an infinite loop. Everything then started to fail. gnome-terminal wouldn't open, xterm wouldn't open, menus wouldn't respond. Etc.The entire GNOME desktop was inoperable.
Logging out and choosing Fluxbox and KDE didn't help. I was sent right back to the GDM login screen. Hmm... seems not related entirely to GNOME... if it all.From a terminal, I could see constant crashes, segfaults on libc6-2.11.1..While at it, I logged on another account (my wife's) and everything was perfectly FINE, with no issues at all. Creating them another account and initializing, it also didn't happen any segfaults. However, everytime I logged in my own account, everything would happen again... nautilus respawning, no terminal, nothing, not even logout would work. Either I hit a MAJOR BUG in libc6 current ubuntu compile, or a setting file inside my home dir got really corrupted and screwed up. It was very frustrating, because this bug was a show stopper. For those who concern, my mobo is an Asus M3A78-EM running a ATI HD 3200 IGP, and I have ubuntu-default fglrx running.
I had run memtest+ overnight and no errors whatsoever. The fact that this was an "account specific" issue deems that there is no hardware fault. I had to migrate my old account to a newly created account, it was hard work because of my 100GB files. Setting ownership in each of them, etc. Everything is OK now, but I really wished to know what dimmed out my bright Lucid Lynx experience yesterday. And I just hope this doesn't happen again.
View 2 Replies
View Related
Dec 2, 2009
I have a Fedora 12 system that I am trying to configure with 3 IP addresses on one NIC card. I created scripts for each of the connections I want in /etc/sysconfig/network-scripts/ and they are called ifcfg-eth0, ifcfg-eth0:1, ifcfg-eth0:2. If I run /sbin/services network restart it configures everything as I would like. When I restart the computer the only device configured is eth0 and it is set to DHCP. If I run the script again everything works. What am I missing to make this change persistent?
View 2 Replies
View Related
Jun 27, 2010
Am using 10.04 and quite happy with the way it is working. my nephew and my mother have also switched to ubuntu.
To save on internet usage and load on the ubuntu servers, can i download upgrade files in one computer and then upgrade all systems?
View 3 Replies
View Related
Sep 22, 2010
Is there any way to load up multiple linux flavors (such as ubuntu and its variations, backtrack, dsl, desbian,ect..) on to a USB drive with persistence?
View 2 Replies
View Related
Apr 7, 2010
My requirement is to route ssh sessions from a single head node to multiple slave nodes. So what i want is, for a client there is just one point of entry (master/head node) to ssh into, it evaluates the load on the slave nodes connected on to internal network and routes the ssh session, kind of a ssh load balancer. Do you have any idea what open source solution i can apply for my problem?
I have tried using LVS piranha, it works well for http and https load balancing but not for ssh load balancing.
View 4 Replies
View Related
Jun 24, 2009
I've browsed the internet, but haven't found a satisfying answer. Hope this forum can help me in the right direction.I'm exploring the possibilities of creating a program that manipulates (writes to) two different video cards.I program in C and hope to avoid high level libraries like Xlib to keep the mem footprint as low and the performance as high as possible. Windowing is not important no desktop environment will be used. Be able to write two pixels (one to each screen) to would do.
How would I go about?To give an idea of the solution I'm looking for:One screen will show thumbnails of images on the hard drive. Clicking an thumbnail on display A will show the selection full screen on display B. On a laptop; preferably thumbnails on the laptop screen and the selected image on the external monitor.Is this possible with just low-level libs or do I need X or some third-party software to make life easy?
View 14 Replies
View Related
Nov 18, 2009
I am trying to install sqlite-python package in my FC11 machine. I couldn't find an rpm to install.
View 2 Replies
View Related
Feb 4, 2010
I'm having a bit of trouble with a web server running Fedora 12. Apache works fine, and serves up php content without a hitch. My problem is SQLite -- I thought that it was built into php5, but support is disabled in the repo version. phpinfo shows this as part of the configure command:
Code:
'--without-sqlite' ... '--disable-pdo' ... '--without-sqlite3'
The only solution I've read anywhere is "compile php from source," but I'd like to avoid that if possible, for ease of future upgrades. Is there a way to convince php to use sqlite despite its current state?
View 8 Replies
View Related
Jan 29, 2011
Is there a binary available somewhere, even if it's a non-Fedora repo?
View 8 Replies
View Related
Apr 18, 2011
Based on Product highlights - openSUSE, it would appear that using sqlite3 in gnucash would be available. However, I do not have an option to save an existing book to the database format, nor is it available when creating a new book - only xml is available. Is there anything special that I need to do to enable the sqlite backend?
View 2 Replies
View Related
Sep 13, 2011
When I try to install Zimbra 7.1.2, the installation fails because it cannot find sqlite. I used strace and found that it uses "rpm -q sqlite" to find the package. But it fails-"package sqlite is not installed". Although I have sqlite installed:
Code:
#rpm -qa | grep sqlite
mono-data-sqlite-2.6.4-2.13.x86_64
[code]....
View 6 Replies
View Related
Feb 27, 2010
With this sqlite query ? I have these tables:
what is the query to list all cities and its neighboring cities like this?
View 5 Replies
View Related
Apr 22, 2011
I am trying to connect to sqlite via perl:
Code:
#! /usr/bin/perl
use LWP::Simple;
use XML::DOM;
use DBI;
[Code]....
View 1 Replies
View Related
Apr 15, 2011
How do I install php-sqlite extension on fedora 14.
View 5 Replies
View Related
May 28, 2010
i am trying to compile too the sqlite for arm9 - mini2440.could you please tell me what was the steps you make? im read that book but im still having some trouble while i compile i have been trying to do the compilation.
View 3 Replies
View Related
Jun 3, 2010
Once upon a time when I started sqlite from the command line I could using the tabbing autocomplete to enter the database name. This has not worked for a while now.
View 1 Replies
View Related
May 24, 2010
This query is giving "Unable to open data base" can anybody suggest what's wrong with this query.
sudo echo "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url
FROM moz_places, moz_historyvisits
WHERE moz_places.id = moz_historyvisits.place_id;" | sqlite3 moz_places.sqlite, moz_historyvisits.sqlite
View 1 Replies
View Related