forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fortran examples

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> MySQL for OpenVMS
View previous topic :: View next topic  
Author Message
dario.karlen



Joined: 13 Mar 2008
Posts: 4

PostPosted: Thu Mar 13, 2008 3:43 pm    Post subject: Fortran examples Reply with quote

Hi all

Does anybody have some fortran examples how to connect and maipulate data within mysql? I would really accreciate a helpfull introduction into this topic.
Thanks a lot
Dario
Back to top
View user's profile Send private message
bisonmalembouche



Joined: 01 Jun 2005
Posts: 74

PostPosted: Thu Mar 13, 2008 4:25 pm    Post subject: Reply with quote

I do not see Fortran listed at the various forums at
http://forums.mysql.com/index.php?42

May be you can use MySQLdb, a Python interface for Mysql
http://dustman.net/andy/python/MySQLdb_obsolete/doc/MySQLdb.html

You have some code at
http://mysql-python.sourceforge.net/MySQLdb.html
(in C only)

I have started documenting the modules you can see at
http://vmspython.dyndns.org/pyhtmldoc/
in
/python_root/local

at the wiki
http://vmspython.dyndns.org/Module%20documentation
but unfortunately I have not yet given an example for MySQLdb.

As this is a wiki, feel free to contribute Smile
Back to top
View user's profile Send private message Send e-mail
rft



Joined: 20 Jun 2007
Posts: 43
Location: Massachusetts

PostPosted: Thu Dec 04, 2008 12:42 am    Post subject: Reply with quote

I will post a very simple FORTRAN API that we have developed. The heart is a small C wrapper for the MYSQL C API.

It will take me some time to package it and provide reasonable documentation.
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Thu Dec 04, 2008 1:58 pm    Post subject: Reply with quote

Thanks, I'm sure that this will be helpful.

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
icl



Joined: 26 Oct 2007
Posts: 29
Location: London, UK

PostPosted: Thu Jul 23, 2009 4:01 pm    Post subject: Reply with quote

rft have you made any progress on the FORTRAN API?

If you want I am happy to help out with it.
Back to top
View user's profile Send private message
rft



Joined: 20 Jun 2007
Posts: 43
Location: Massachusetts

PostPosted: Wed Sep 02, 2009 4:58 pm    Post subject: Reply with quote

Unfortunately other projects have taken priority, the following link is to the documentation:

http://asthomas.com/mysql_dist/MySQL_AST.htm

A zip file containing a VMS backup is availabe at:

http://asthomas.com/mysql_dist

The critical source are the C jacket routines in FOR_MYSQL.C

The fortran routines for mimicking RMS ISAM file I/O are based on our internal programming conventions to allow for migrating from RMS to other database systems. (It would be nice to add RMS as an alternative to InnoDB in MySQL)

The Fortran sources and includes are in the .TLB

There are probably many more C headers than are necessary.

The interface is primitive, but works well for our needs at this time.
Back to top
View user's profile Send private message
icl



Joined: 26 Oct 2007
Posts: 29
Location: London, UK

PostPosted: Wed Sep 02, 2009 11:11 pm    Post subject: Reply with quote

Thanks for that.

Unfortunately there is a problem with the download. I can unzip the BCK file but when I try to list this [BAC/LIS MYSQL_ISAM.BCK/SAV] - I get an error that it isn't a valid Backup file.

I tried this with a download both via Windows and direct onto a VMS server with the same results in both cases. I used the UNZIP within OpenVMS to unpack the BCK using: unzip "-V" mysql_isam.zip

It looks like your BCK got "windowfied" on a transfer into the windows domain (possibly prior to zipping). Is there an anonymous FTP location on an OpenVMS site that can be used?
Back to top
View user's profile Send private message
rft



Joined: 20 Jun 2007
Posts: 43
Location: Massachusetts

PostPosted: Wed Sep 02, 2009 11:53 pm    Post subject: Reply with quote

The file was zipped using the ZIP utility that HP packages with OpenVMS.

Use the following command to properly set the file attributes:

set file mysql_isam.bck /attr=(rfm:fix,rat:none,lrl:32256)
Back to top
View user's profile Send private message
icl



Joined: 26 Oct 2007
Posts: 29
Location: London, UK

PostPosted: Wed Sep 02, 2009 11:56 pm    Post subject: Reply with quote

that works a trick (Thanks for that tip - I can use that at other times)

Very Happy
Back to top
View user's profile Send private message
rft



Joined: 20 Jun 2007
Posts: 43
Location: Massachusetts

PostPosted: Thu Sep 03, 2009 12:09 am    Post subject: Reply with quote

Upon linking there wqill be a number of undefined symbols. These are routines that are not accessed and the unresolved symbols can be ignored.
Back to top
View user's profile Send private message
Emanuel Meireles



Joined: 11 Dec 2014
Posts: 1

PostPosted: Thu Dec 11, 2014 8:27 pm    Post subject: Reply with quote

Rtf,

I am going to start a new project to upgrade a VAX to Itanium and I was thinking to install MySQL. All the applications are in fortran, could I use the FORTRAN API that you wrote to fill the tables with the data that I want to ?

Thanks,

Emanuel
Back to top
View user's profile Send private message Send e-mail
rft



Joined: 20 Jun 2007
Posts: 43
Location: Massachusetts

PostPosted: Tue Sep 29, 2015 5:59 pm    Post subject: Reply with quote

Sorry for the delay in responding. We are using the FORTRAN interface for production programs. We have created two levels of interface:

1) A simple level that is just jacket routines to basic C/C++ interface, i.e. establish a connection and then issue SQL commands.

2) A mechanism to mimic the DEC extensions for multi-key ISAM (INDEXED) files:
Open
key read
keyed sequential read
write
update
delete
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> MySQL for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group