GeneralSpeculative QUERY - SQL and LaTeX

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Il-uvatar
Posts: 2
Joined: Mon Feb 02, 2015 1:57 pm

Speculative QUERY - SQL and LaTeX

Post by Il-uvatar »

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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Post by Johannes_B »

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?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Il-uvatar
Posts: 2
Joined: Mon Feb 02, 2015 1:57 pm

Re: Speculative QUERY - SQL and LaTeX

Post by Il-uvatar »

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
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Speculative QUERY - SQL and LaTeX

Post by Stefan Kottwitz »

Hi,

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
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Speculative QUERY - SQL and LaTeX

Post by nlct »

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
Post Reply