ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* LaTeXDB equivalent for ConTeXt ?
@ 2003-08-20 11:36 Jules Colding
  2003-08-21 21:37 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Jules Colding @ 2003-08-20 11:36 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: LaTeXDB equivalent for ConTeXt ?
  2003-08-20 11:36 LaTeXDB equivalent for ConTeXt ? Jules Colding
@ 2003-08-21 21:37 ` Hans Hagen
  2003-08-22  9:01   ` Jules Colding
  2003-08-22 21:09   ` Jules Colding
  0 siblings, 2 replies; 4+ messages in thread
From: Hans Hagen @ 2003-08-21 21:37 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: LaTeXDB equivalent for ConTeXt ?
  2003-08-21 21:37 ` Hans Hagen
@ 2003-08-22  9:01   ` Jules Colding
  2003-08-22 21:09   ` Jules Colding
  1 sibling, 0 replies; 4+ messages in thread
From: Jules Colding @ 2003-08-22  9:01 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: LaTeXDB equivalent for ConTeXt ?
  2003-08-21 21:37 ` Hans Hagen
  2003-08-22  9:01   ` Jules Colding
@ 2003-08-22 21:09   ` Jules Colding
  1 sibling, 0 replies; 4+ messages in thread
From: Jules Colding @ 2003-08-22 21:09 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-08-22 21:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-20 11:36 LaTeXDB equivalent for ConTeXt ? Jules Colding
2003-08-21 21:37 ` Hans Hagen
2003-08-22  9:01   ` Jules Colding
2003-08-22 21:09   ` Jules Colding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).