By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,949 Members | 2,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,949 IT Pros & Developers. It's quick & easy.

Python with Oracle and SQLite

P: 1
Hi,

I just started playing with Python and I am working on a program that pulls data from a table in Oracle and creates a similar table in SQLite. Basically, I want to be able to do this:
create table tab1 as
select *
from tab2

where tab1 is an SQLite table and tab2 is an Oracle table. Is this possible? I have 2 connection objects, but when I try to run this code Python replies that tab2 cannot be found. I am thinking it is trying to look for tab2 in SQLite, and of course it's not there - it needs to look for that table in the Oracle connection.
I tried pulling data from Oracle in one step, then looping over the results and inserting back into SQLite one by one, but that's not very efficient and it makes the code harder to follow.
If any of you know how to do this, I would greatly appreciate your responses.

Thanks!
Apr 20 '06 #1
Share this Question
Share on Google+
1 Reply


P: 12
dvs
It's almost impossible to write it in one step. We can imagine the Oracle stored procedure which will write data to SQLite tables, but it's only the kind of optimization.
All the variants have to move data from oracle_hard_disk_files to sqlite_hard_disk_files.
BTW, I wrote similar table-unspecific tool for moving tables from Paradox to DB2 databases. It can be easily adopted to (Oracle->SQLite) case. Contact me tormoz[@]gmx.net.
Jul 20 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.