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}%
        [EMAIL PROTECTED]@EA\relax
      \else
        \immediate\write\scratchwrite{##1;}%
        [EMAIL PROTECTED]
      \fi##2}%
   \immediate\openout\scratchwrite=\bufferprefix\jobname-sql.sql
   [EMAIL PROTECTED]:#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 | [EMAIL PROTECTED]
                      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
-------------------------------------------------------------------------

_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to