ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* database
@ 2007-01-23  8:45 Wolfgang Werners-Lucchini
  2007-01-24  2:44 ` database Mojca Miklavec
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Werners-Lucchini @ 2007-01-23  8:45 UTC (permalink / raw)


Hallo!

I tried some examples with m-database and Mojca's 'My Way' and had 
some problems

==========Example-1===============================================
\defineseparatedlist[NaturalTable][separator=comma,%quotechar={"},
                                                  before=\bTABLE,
                                                  after=\eTABLE,
                                                  first=\bTR,
                                                  last=\eTR,
                                                  left=\bTD,
                                                  right=\eTD]

\startseparatedlist[NaturalTable]
Of,course
    ,it is!
\stopseparatedlist
==================================================================
This example does only work as expected if one explicitly gives 
quotechar. So what is the default quotechar? Can anybody explain the 
above behaviour?



==========Example-2===============================================
\def\Whatever#1#2#3{[#1][#2][#3]\endgraf}

\defineseparatedlist[CSVX][command=\Whatever,
   separator={,},
%   quotechar={"},
   first=\bTR,last=\eTR,
   left=\bTD,right=\eTD,
   before=\bTABLE,after=\eTABLE]

\startCSVX
eins,"und, zwei",drei
one,two,three
\stopCSVX
==================================================================
If I give an command (\Whatever) then the options 'first', 'last', 
'left', 'right', 'before' and 'after' are ignored. That's ok, I 
think!

But if I uncomment the quotechar option, then the options 'left' and 
'right' are no longer ignored. Commenting them out or settings like 
'left=' etc. are not working. What I am doing wrong here?


==========Example-3===============================================
\processquotedlist(){,}{"}\command(a=>b=>c=>d)
==================================================================
Does not work for me. Can anybody give an example?

'\processseplist' does not work too. There has to be an '%' in front 
of 'raw'!

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Database....
@ 2003-07-07 10:13 Willi Egger
  0 siblings, 0 replies; 6+ messages in thread
From: Willi Egger @ 2003-07-07 10:13 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

Hi Contexters

Is there anybody who has experionce with the database options as
described in core-dat?

I tried to setup an address-database. But I am unable to get it working.
I get an error message saying "missing \endcsname"

Please have a look at the enclosed testfiles.

Cheers Willi

[-- Attachment #2: database.tex --]
[-- Type: text/x-tex, Size: 1336 bytes --]

% Sample record

\def\DoWithRecord#1%
   {\startpacked
    \let\\=\quad
    name:  \getrecordentry{name}~\getrecordentry{family name}\par
    address: \getrecordentry{postal address}\par
    \stoppacked}

\definerecord[address][command=\DoWithRecord]
\setuprecord[address][command=\DoWithRecord]


\definerecordentry[address][Name]
\definerecordentry[address][Surname]
\definerecordentry[address][Foreletters]
\definerecordentry[address][Street]
\definerecordentry[address][StreetNumber]
\definerecordentry[address][Place]
\definerecordentry[address][PostalCode]
\definerecordentry[address][FunctionNL]
\definerecordentry[address][Function]
\definerecordentry[address][Phone]
\definerecordentry[address][Fax]
\definerecordentry[address][Email]


\startrecord{Hans}
\memberofgroup                  {board}
\setrecordentry{Name}           {Hans}
\setrecordentry{Surname}        {Hagen}
\setrecordentry{Foreletters}    {H.}
\setrecordentry{Street}         {Ridderstraat}
\setrecordentry{StreetNumber}   {27}
\setrecordentry{Place}          {Hasselt}
\setrecordentry{PostalCode}     {8061 GH}
\setrecordentry{FunctionNL}     {Voorzitter NTG}
\setrecordentry{Function}       {President NTG}
\setrecordentry{Phone}          {38-4775369}
\setrecordentry{Fax}            {38-4775374}
\setrecordentry{Email}          {pragma@wxs.nl}
\stoprecord

[-- Attachment #3: test.tex --]
[-- Type: text/x-tex, Size: 1460 bytes --]

% Footertexts
% Database
% W. Egger
% 3.07.2003

\setupoutput[pdftex]

%\input NTG-board-members

\processrecords[database.tex][Hans]

\def\FootItemHeaderI{Telefoon}
\def\FootItemHeaderII{Webstek}
\def\FootItemHeaderIII{}
\def\FootItemHeaderIV{e-mail}
\def\FootItemI{0485 573896}
\def\FootItemII{www.boede.nl}
\def\FootItemIII{}
\def\FootItemIV{w.egger@boede.nl}


\startbuffer[SetUpFooterText]
       \hbox to \textwidth{%
         \vbox{% Hans Hagen: needed either \hbox or \vbox; 04-05-2003\setupfootertexts[{\getbuffer[SetUpFooterText]}][]
             \starttabulate[|*{4}{lw(.25\textwidth)|}]
                \NC {\tfx \FootItemHeaderI}
                \NC {\tfx \FootItemHeaderII}
                \NC {\tfx \FootItemHeaderIII}
                \NC {\tfx \FootItemHeaderIV} \NC\NR
                \NC \switchtobodyfont[rm] \FootItemI
                \NC \switchtobodyfont[rm] \FootItemII
                \NC \switchtobodyfont[rm] \FootItemIII
                \NC \switchtobodyfont[rm] \FootItemIV \NC\NR
             \stoptabulate%
          }%
       }%
\stopbuffer

\setupfootertexts[{\getbuffer[SetUpFooterText]}]

\starttext

Some text

\startlines
\getrecordentry{Name}
\getrecordentry{Surame}
\getrecordentry{Foreletters}
\getrecordentry{Street}
\getrecordentry{StreetNumber}
\getrecordentry{Place}
\getrecordentry{PostalCode}
\getrecordentry{FunctionNL}
\getrecordentry{Function}
\getrecordentry{Phone}
\getrecordentry{Email}
\stoplines

\stoptext

^ permalink raw reply	[flat|nested] 6+ messages in thread
* database
@ 2003-04-23 18:55 LEGUEDOIS, Frederic
  2003-04-25 10:23 ` database Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: LEGUEDOIS, Frederic @ 2003-04-23 18:55 UTC (permalink / raw)


Hello,

I'm new user of ConTeXt (for one week) and I would like to connect ConTeXt
with a database(Oracle, PostegreSQL, MySQL...). Is it possible or must I
write a PERL script to export datas in XML files ? I found this in mail
archive :

\startSQL

my_query

\stopSQL

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?

Thanks in advance,

P.S. : I'm French and my English isn't very good. I'm sorry about this.

Frederic Leguedois

###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/

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

end of thread, other threads:[~2007-01-24  2:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-23  8:45 database Wolfgang Werners-Lucchini
2007-01-24  2:44 ` database Mojca Miklavec
  -- strict thread matches above, loose matches on Subject: below --
2003-07-07 10:13 Database Willi Egger
2003-04-23 18:55 database LEGUEDOIS, Frederic
2003-04-25 10:23 ` database Taco Hoekwater
2003-04-25 11:21   ` database Hans Hagen

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