I wish to create LaTeX documents that will contain SQL queries which will retrieve data. This data will be used to fill field variables for two purposes:
i. to print out formatted content e.g. like names and addresses in a Word 'mailmerge'
ii. as variables for the control of the output e.g. the 'copies' variable value might be read from the SQL database in order to print 3 copies of the document.
Can anyone suggest a good tool to solve my problem? It could be a suitable add-on or code environment that may easily permit the development of facility under Windows 7.
I have looked at a few, but they seem to be very 'kludgy' or only for Linux.
I would also like to use the LaTeX IDE TexnicCenter.
General ⇒ Speculative QUERY - SQL and LaTeX
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Speculative QUERY - SQL and LaTeX
Hi and welcome,
this reminds me abit of WYSIWYG editor for SQL. A query where i didn't really understand the question as well.
Can you read through that and maybe clarify the question?
this reminds me abit of WYSIWYG editor for SQL. A query where i didn't really understand the question as well.
Can you read through that and maybe clarify the question?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Re: Speculative QUERY - SQL and LaTeX
Dear Johannes_B
Sorry about the confusion. That is the problem with writing posts at around midnight
As I said above, I am new to LaTeX, so this feature may already exist and I am completely unaware of its existence. Is there, perhaps, some add-on or suite of macros/templates etc. that fulfils this function.
Distilled down, the function I require is: a suitable 'interface' between LaTeX and an SQL database (say, MYSQL) under Windows 7, which will allow simple SQL queries from within a LaTeX file?
Regards
Sorry about the confusion. That is the problem with writing posts at around midnight

As I said above, I am new to LaTeX, so this feature may already exist and I am completely unaware of its existence. Is there, perhaps, some add-on or suite of macros/templates etc. that fulfils this function.
Distilled down, the function I require is: a suitable 'interface' between LaTeX and an SQL database (say, MYSQL) under Windows 7, which will allow simple SQL queries from within a LaTeX file?
Regards
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Speculative QUERY - SQL and LaTeX
Hi,
and welcome to the forum!
That's possible with LaTeX. Specifically, with LuaLaTeX, you could access databases using luasql.
The installation of
Stefan
and welcome to the forum!
That's possible with LaTeX. Specifically, with LuaLaTeX, you could access databases using luasql.
The installation of
luasql
might be a challenge, but using it within LaTeX is not so hard.Stefan
LaTeX.org admin
Speculative QUERY - SQL and LaTeX
You could try a combination of datatooltk and datatool, but at the moment datatooltk only supports MySQL. The data is fetched using a select statement the command line arguments of datatooltk and it then creates a file that can be input and processed by datatool. Note that datatooltk is a Java application, so you need the Java Runtime Environment installed, but this does at least mean that it will run on Windows.
Regards
Nicola Talbot
Regards
Nicola Talbot
LaTeX Resources: http://www.dickimaw-books.com/latexresources.html
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/