Received: from linux.stuco.uni-klu.ac.at (IDENT:qmailr@linux.stuco.uni-klu.ac.at [143.205.200.10]) by hub.org (8.9.2/8.9.1) with SMTP id GAA00945 for ; Sat, 20 Feb 1999 06:33:32 -0500 (EST) (envelope-from mmoedern@linux.stuco.uni-klu.ac.at) Received: (qmail 9756 invoked from network); 20 Feb 1999 11:33:32 -0000 Received: from kungfu.stuco.uni-klu.ac.at (HELO linux.stuco.uni-klu.ac.at) (143.205.200.98) by linux.stuco.uni-klu.ac.at with SMTP; 20 Feb 1999 11:33:32 -0000 Message-ID: <36CE9DA5.3A838037@linux.stuco.uni-klu.ac.at> Date: Sat, 20 Feb 1999 12:33:57 +0100 From: Martin =?iso-8859-1?Q?M=F6derndorfer?= Organization: IMAF Branch Austria X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: de-AT,en,ja MIME-Version: 1.0 To: "Anatoly K. Lasareff" CC: pgsql-sql@postgreSQL.org Subject: Re: [SQL] Triggers to create Tables References: <36CDA175.C0710662@linux.stuco.uni-klu.ac.at> <87n2295njt.fsf@tolikus.hq.aaanet.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hm, Stylesheets do not change often, it would be better to read them from textfile than querying the database at the beginning of each html file which includes it. MArtin "Anatoly K. Lasareff" wrote: > > >>>>> "d" == derndorfer writes: > > d> hi, > d> this is the part II of a question i already asked: > > d> i have some tables: > d> create table css_class(nr int4, classname varchar(50)); > d> create table css_prop(nr int4, name varchar(50), val varchar(50), > d> classnr int4); > d> (css_prop.classnr foreign key-> css_class.nr) > > d> i would need a trigger on update and insert who takes all entries from > d> the tables above and put them into a textfile in the following stype > > d> .n-th_of_css_class { > d> n-th_of_css_prop.name(*) : n-th_of_css_prop.val(*); > d> n+1-th_of_css_prop.name(*): [...] > d> } > d> .n+1-th_of_css_class { [...] > > d> with other words: i want to create a cascading style sheet out of the > d> table: > d> css files look something like that > > d> .cassname { > d> property1 : value_prop1; > d> property2 : value_prop2; > d> [...] > d> } > d> [...] > > d> Can anyone help? > d> a c-function would be ok too (_really_ think that i need one) but the > d> file has to be created by the database itself. > > d> Idea for the future: whole html pages built out of the databased > d> resulted by trigger/query combination. (not the question _yet_) > > d> MArtin > > I think this is bad idea to build text file every time you change the > tables. What about external program (on C, Perl... etc) what rebuilds, > pehaps incrementally, file(s) with changed data? Or creating style > sheets and html pages 'on the fly' with any cgi-script? > > -- > Anatoly K. Lasareff Email: tolik@icomm.ru > Senior programmer