473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ctree data

A friend needs to convert c-tree plus data to MySql. I can to the "to MySql
part, but need some help with the "from c-tree." If I just wanted to get this
done, I would hunt down the ODBC driver and use some MSy thing. But I am trying
to hone my Python skills, but right now I am in over my head, thus this post. I
think with a little boost I will be able to make it all come together. (well,
little boost may be an understatement - I have no clue how close/far I am from
what I need.)

My searching around has come up with a few ways to use Python to read the data:

1. pull what I need from some other py code that uses c-tree:

http://oltp-platform.cvs.sourceforge....h?view=markup
http://oltp-platform.cvs.sourceforge...py?view=markup

12 a,b,c = ZipCode.Get()
13 print "Zip code is ", a
14 print "State is ", b
15 print "City is ", c

I am sure this is what I want. I just haven't figured out where to start.

2. "Pyrex" to create Python bindings to C API with minimal C knowledge. I took
C and did a few little utilities on my own in the 90's. plus I can make a
tarball. today I am not sure I even qualify for "minimal."

3. the C API is present as a shared object (.so), use it from Python with
ctypes. I have no idea what that means.

4. odbc - I am actually not thrilled about using the ctree odbc driver in any
environment, because someone else who tried to use it on some other data a few
years ago said it was flaky, and support was next to useless.

5, get someone who knows perl to do it using
http://cpan.uwinnipeg.ca/htdocs/Db-Ctree/Db/Ctree.html - This just shows what
lengths I am willing to go to. but I really don't want to start learning perl.

TIA
Carl K
May 12 '07 #1
2 4877

"Carl K" <ca**@personnelware.comwrote in message
news:r4******************************@comcast.com. ..
|A friend needs to convert c-tree plus data to MySql. I can to the "to
MySql
| part, but need some help with the "from c-tree." If I just wanted to get
this
| done, I would hunt down the ODBC driver and use some MSy thing. But I am
trying
| to hone my Python skills,
| My searching around has come up with a few ways to use Python to read the
data:
|
| 1. pull what I need from some other py code that uses c-tree:
|
|
http://oltp-platform.cvs.sourceforge....h?view=markup
|
http://oltp-platform.cvs.sourceforge...py?view=markup
|
| 12 a,b,c = ZipCode.Get()
| 13 print "Zip code is ", a
| 14 print "State is ", b
| 15 print "City is ", c
|
| I am sure this is what I want. I just haven't figured out where to
start.
|
| 2. "Pyrex" to create Python bindings to C API with minimal C knowledge.
I took
| C and did a few little utilities on my own in the 90's. plus I can make
a
| tarball. today I am not sure I even qualify for "minimal."
|
| 3. the C API is present as a shared object (.so), use it from Python with
| ctypes. I have no idea what that means.
[snip]

I personally would start with either 1 or 3, but probably 3 since the skill
of using ctypes is transferable to other problems and I want to learn it
anyway. Ctypes is a foreign function interface (FFI) module. It is new in
the Python stdlib with 2.5 but has been around as a 3rd party module much
longer. With a specification of the C API in hand, you should be able to
write Python functions that call functions in the shared library. Ctypes
handles the interconversion of Python and C datatypes and the calling
details.

I would start with the simplest thing that you can verify working: open
database, get some info that you can print, so you know you really opened
it, and close database.

Terry Jan Reedy


May 12 '07 #2
On May 13, 7:05 am, Carl K <c...@personnelware.comwrote:
A friend needs to convert c-tree plus data to MySql. I can to the "to MySql
part, but need some help with the "from c-tree." If I just wanted to get this
done, I would hunt down the ODBC driver and use some MSy thing. But I am trying
to hone my Python skills, but right now I am in over my head, thus this post. I
think with a little boost I will be able to make it all come together. (well,
little boost may be an understatement - I have no clue how close/far I am from
what I need.)

My searching around has come up with a few ways to use Python to read the data:

1. pull what I need from some other py code that uses c-tree:

http://oltp-platform.cvs.sourceforge...OLTPP/scripts/...

12 a,b,c = ZipCode.Get()
13 print "Zip code is ", a
14 print "State is ", b
15 print "City is ", c

I am sure this is what I want. I just haven't figured out where to start.

2. "Pyrex" to create Python bindings to C API with minimal C knowledge. I took
C and did a few little utilities on my own in the 90's. plus I can make a
tarball. today I am not sure I even qualify for "minimal."

3. the C API is present as a shared object (.so), use it from Python with
ctypes. I have no idea what that means.

4. odbc - I am actually not thrilled about using the ctree odbc driver in any
environment, because someone else who tried to use it on some other data a few
years ago said it was flaky, and support was next to useless.

5, get someone who knows perl to do it usinghttp://cpan.uwinnipeg.ca/htdocs/Db-Ctree/Db/Ctree.html- This just shows what
lengths I am willing to go to. but I really don't want to start learning perl.
Possible option 6: Find out if there is (a) a ctree utility program
that dumps a ctree table to a flat file in documented easily-parsed
format plus (b) a method of getting the metadata for each column
(type, decimal places, etc) if that info is not already available from
(a).

It's entirely possible that SQL "select * from the_table" will do (a)
for you, if the output is given with full precision, and there's a
method of getting the columns delimited properly.

HTH,
John

May 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lawrence | last post by:
I had some code that worked fine for several weeks, and then yesterday it stopped working. I'm not sure what I did. Nor can I make out why it isn't working. I'm running a query that should return 3...
11
by: Qiangning Hong | last post by:
A class Collector, it spawns several threads to read from serial port. Collector.get_data() will get all the data they have read since last call. Who can tell me whether my implementation correct?...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
3
by: bbernieb | last post by:
Hi, All, Is it possible to access a variable inside of a data binding, without the variable being out of scope? (Note: On the DataBinder line, I get an error message that says "Name 'i' is...
5
by: Gene | last post by:
What can I do if I want to get the result using the sql command? for example, the select command is "select Name from Employee where StaffID=10" How to get the "Name"??? dim Name as string and...
5
by: DC Gringo | last post by:
I am having a problem reading a simple update to the database. Basically I'm testing a small change to the pubs database -- changing the price of the Busy Executive's Database Guide from 19.99 to...
0
by: Rodrigo Carvalhaes | last post by:
Hi Guys! Anyone already made a importation from CTREE files ( files .dtc) to PostgreSQL ? I know that there is a "contrib" tool to import files from dbf to sql... Any tip ? --
14
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
0
by: Winder | last post by:
Computer Data Recovery Help 24/7 Data recovering tools and services is our focus. We will recover your data in a cost effective and efficient manner. We recover all operating systems and media....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.