Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

tcl/tk programming to a database

Posted on 2009-04-05
6
Medium Priority
?
754 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 1500 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
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 
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

Amazon Web Services EC2 Cheat Sheet

AWS EC2 is a core part of AWS’s cloud platform, allowing users to spin up virtual machines for a variety of tasks; however, EC2’s offerings can be overwhelming. Learn the basics with our new AWS cheat sheet – this time on EC2!

Question has a verified solution.

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

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 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