From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/12055 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: database Date: Fri, 25 Apr 2003 13:21:02 +0200 Sender: ntg-context-admin@ntg.nl Message-ID: <5.2.0.9.1.20030425131916.01527d38@server-1> References: <21413054A555D5118C9600805FC1B17ECC0D5D@CASERV02> <21413054A555D5118C9600805FC1B17ECC0D5D@CASERV02> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_16939778==_" X-Trace: main.gmane.org 1051269966 24605 80.91.224.249 (25 Apr 2003 11:26:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 25 Apr 2003 11:26:06 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Fri Apr 25 13:26:05 2003 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1991L0-0006OF-00 for ; Fri, 25 Apr 2003 13:25:54 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 5348D10B10; Fri, 25 Apr 2003 13:26:53 +0200 (MEST) Original-Received: from mail.solcon.nl (mail.solcon.nl [212.45.33.11]) by ref.ntg.nl (Postfix) with ESMTP id 6911A10AB6 for ; Fri, 25 Apr 2003 13:23:34 +0200 (MEST) Original-Received: from server-1.pragma-net.nl (wc-58016.solcon.nl [212.45.58.16]) by mail.solcon.nl (8.12.9/SQL-8.12.9-10/8.12.5) with ESMTP id h3PBNbdX031473 for ; Fri, 25 Apr 2003 13:23:37 +0200 Original-Received: from laptop-3.wxs.nl (laptop-3 [10.100.1.191]) by server-1.pragma-net.nl (8.12.3/8.12.2) with ESMTP id h3PBNU0e015024 for ; Fri, 25 Apr 2003 13:23:30 +0200 X-Sender: hagen-mail@server-1 X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Original-To: ntg-context@ntg.nl In-Reply-To: <20030425122352.587e40c5.taco@elvenkind.com> X-RAVMilter-Version: 8.4.1(snapshot 20020919) (mail.solcon.nl) Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:12055 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:12055 --=====================_16939778==_ Content-Type: text/plain; charset="us-ascii"; format=flowed In addition to taco's stuff i attached what i could locate on my machine (last year i played a bit with mysql and storing xml and so) Hans >What you are asking for (MySQL I/O) cannot be done. The context >command you refer to intended solely for syntax highlighting of >SQL statements. > >However, you got me thinking. :) > >See attached context module and test file. It's extremely crude >and more of a proof of concept than a full module, but it seems >to work OK on the simple tests I threw at it. All of the commands >and macros it provides are in the demonstration file. > >Stuff to keep in mind: > >- \write18 had better be enabled > >- the statement is fed to a 'mysql' in batchmode during \MySQLexecute > >- The result is saved to a file named \jobname-[Queryname]-result.dat > >- You always have to re-execute before you attempt to process the > the results > >- The 'Countexecutable' is supposed to return a single line that starts with > the number of lines of the \jobname-[Queryname]-result.dat file. > >- No error checking whatsoever is done. Spefically, nothing is done > about MySQL's output format, so you can expect problems with > embedded newlines and other specials characters > >The module is a joke, ok? But a fun one :-) > >Greetings, Taco > > >On Wed, 23 Apr 2003 20:55:16 +0200, LEGUEDOIS, wrote: > > > but I don't know how to use this (how to use the result of the query, where > > I write database connection's parameters...). Do you know where can I > find a > > manual or any help? > > >-- >groeten, > >Taco > >================================================================ >Deze e-mail is door E-mail VirusScanner van Planet Internet gecontroleerd >op virussen. >Op http://www.planet.nl/evs staat een verwijzing naar de actuele lijst >waar op wordt gecontroleerd. > --=====================_16939778==_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: attachment; filename="xmlvvsql.tex" % interface=en output=pdftex \unprotect \def\??sq{@@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 \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 --=====================_16939778==_ Content-Type: text/plain; charset="us-ascii"; format=flowed ------------------------------------------------------------------------- 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 ------------------------------------------------------------------------- --=====================_16939778==_--