![](https://secure.gravatar.com/avatar/52c586b6e0f0b9b6d7c7ab453bdf6b41.jpg?s=120&d=mm&r=g)
Hi, Is there anything like LaTeXDB: http://privat.hgesser.com/software/latexdb/ in ConTeXt? The short story is that LaTeXDB makes it possible to include SQL queries in a LaTeX document. Best regards, jules
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
At 13:36 20/08/2003 +0200, you wrote:
Hi,
Is there anything like LaTeXDB:
http://privat.hgesser.com/software/latexdb/
in ConTeXt?
The short story is that LaTeXDB makes it possible to include SQL queries in a LaTeX document.
I have played with the following code: % interface=en output=pdftex \unprotect \definesystemvariable{sq} \def\startSQLquery#1#2\stopSQLquery {\setvalue{\??sq:#1}{#2}} \def\applySQLquery#1% last line is quit without ; {\bgroup \def\\{\rawcharacter{`\\}}% \long\def\next##1;##2% {\ifx##2\empty \immediate\write\scratchwrite{##1}% \@EA\gobbleuntil\@EA\relax \else \immediate\write\scratchwrite{##1;}% \@EA\next \fi##2}% \immediate\openout\scratchwrite=\bufferprefix\jobname-sql.sql \@EAEAEA\next\csname\??sq:#1\endcsname\empty\empty;\empty\relax \immediate\closeout\scratchwrite \executeSQLcommand {\bufferprefix\jobname-sql.sql}% {\bufferprefix\jobname-sql.log}% \egroup} \def\executeSQLcommand#1#2% % {\executesystemcommand{c:/mysql/bin/mysql.exe < #1 > #2}} {\executesystemcommand{c:/mysql/bin/mysqldump.exe -r #2 < #1}} \protect % \endinput \starttext \startSQLquery{test} connect cod ; % select leerling into outfile "e:/tmp/test.tmp" from ws_p ; %select data into outfile "e:/tmp/test.tmp" select data from ws_p ; quit \stopSQLquery \applySQLquery{test} \typefile{e:/tmp/test.tmp} \stoptext t There have been discussions of extending the (fptex) url input file support with something that could talk to ports (services) ... maybe its time to pick up that thread. Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
![](https://secure.gravatar.com/avatar/52c586b6e0f0b9b6d7c7ab453bdf6b41.jpg?s=120&d=mm&r=g)
On Thu, 2003-08-21 at 23:37, Hans Hagen wrote:
At 13:36 20/08/2003 +0200, you wrote:
Hi,
Is there anything like LaTeXDB:
http://privat.hgesser.com/software/latexdb/
in ConTeXt?
The short story is that LaTeXDB makes it possible to include SQL queries in a LaTeX document.
<snip>
There have been discussions of extending the (fptex) url input file support with something that could talk to ports (services) ... maybe its time to pick up that thread.
Oh yes. It would be really interesting to be able to have dynamic documents that are able to query an SQL database for some of its content. -- jules
![](https://secure.gravatar.com/avatar/52c586b6e0f0b9b6d7c7ab453bdf6b41.jpg?s=120&d=mm&r=g)
On Thu, 2003-08-21 at 23:37, Hans Hagen wrote:
At 13:36 20/08/2003 +0200, you wrote:
Hi,
Is there anything like LaTeXDB:
http://privat.hgesser.com/software/latexdb/
in ConTeXt?
The short story is that LaTeXDB makes it possible to include SQL queries in a LaTeX document.
I have played with the following code:
BTW: Thank you for the code :-) -- jules
participants (2)
-
Hans Hagen
-
Jules Colding