Solved

tcl/tk programming to a database

Posted on 2009-04-05
6
724 Views
Last Modified: 2013-11-22
I am writing a very simple piece of software in TCL/TK under the linux environment and want to store the data in a database. I have never written any software to interact with a database so this is a first for me. I need to know what databases I can use with TCL/TK and which would interact best with what I want to do if I have multiple choices. I would like to stress that I have never dealt with databases ever before. If there is a tutorial with example code that would be great start. Any and all help will be appreciated.
0
Comment
Question by:georgopanos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 24

Accepted Solution

by:
fridom earned 500 total points
ID: 24074678
In short you can probably use any Database you can get your hands on.

See e.g
http://dev.mysql.com/doc/refman/5.1/de/tcl.html
http://wiki.tcl.tk/10548
http://wiki.tcl.tk/6193

And well if there is not a direct TCL binding there will be some C binding  and you can use any C writen stuff very easily with tcl.

Regards
Friedrich
0
 

Author Comment

by:georgopanos
ID: 24093078
This was a very good start but since I have never worked with databases before it is a little difficult to understand. Is there any concrete code that is a simple database program written in TCL that uses MySQL so I can read the code and understand the interaction between the database and TCL code?
0
 
LVL 15

Expert Comment

by:mish33
ID: 24093658
See http://wiki.tcl.tk/13201

As an example (from http://wiki.tcl.tk/6051):
 package require mysqltcl
 set m [mysqlconnect -user root -db mysql -password foobar]
 mysqluse $m mysql
 foreach res [mysqlsel $m {select host from user} -flatlist] {
     puts $res
 }
 mysqlclose $m

Open in new window

0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 24

Expert Comment

by:fridom
ID: 24094082
There are tons of examples e.g in Openacs codebase, it even connects that with
HTML rendering. There is one exceptional book available which just discusses that. It's named
Philip and Alex's Guide to Web Publishing.

Regards
Friedrich
0
 

Author Comment

by:georgopanos
ID: 24122248
Thank you fridom for your help the combination of those pages and a blip from Professional Linux Programming from Jon Masters helped  quite a bit. I have not completed a program to communicate with the mySQL DBASE yet.
0
 
LVL 24

Expert Comment

by:fridom
ID: 24154746
Have you tried
http://www.xdobry.de/mysqltcl/

?

Regards
Friedrich
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question