473,799 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4894

"Carl K" <ca**@personnel ware.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...@personnel ware.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
2271
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 items from the database. I then get a count of the return, which correctly tells me that I've got 3 items. I then go into a for loop which I expect to loop 3 times and print out the 3 items. Here is where things get strange: it loops 3 times and...
11
1912
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? class Collector(object): def __init__(self): self.data = spawn_work_bees(callback=self.on_received) def on_received(self, a_piece_of_data):
0
5677
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 System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet) at TryThis.Form1.save() in C:\Documents and Settings\Nick\My Documents\...
3
2053
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 not declared". The data bind is for a DataList.)
5
2227
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 then..... what should I do?
5
1795
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 1997 and back. Unfortunately, it seems does reflect the change on my web form. Perhaps it's caching the data retrieved by the SQLDataAdapter? (All of my code is generated by VS.NET '03. FYI, it works fine when I test on my developer...
0
1623
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
14660
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 so I get the ObjectDataSource. No problem ..... ObjectDataSource src = .... //is ok i have it
0
2073
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. Call for a free consultation. http://a.uuload.com/Computer-Data-Recovery.htm LiveVault's Online Recovery Service Protect vital data with LiveVault's offsite backup and data storage. http://a.uuload.com/Computer-Data-Recovery.htm
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.