Re: XML -> PG ?

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: XML -> PG ?
Date: 2009-05-06 16:24:46
Message-ID: gtsdkf$nhc$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gauthier, Dave, 06.05.2009 17:40:
> Maybe...
>
> <ALL>
> <EMPLOYEES>
> <EMP EMP_NAME="JOE" JOB="CARPENTER" />
> EMP EMP_NAME="FRANK" JOB="PLUMBER"/>
> EMP EMP_NAME="SUE" JOB="CARPENTER"/>
> </EMPLOYEES>
> <JOBS>
> <JOB JOB_NAME="CARPENTER" SALARY=25.50 />
> <JOB JOB_NAME="PLUMBER" SALARY=28.75 />
> </JOBS>
> </ALL>
>
> ...equals...
>
> create table employees (emp_name varchar[64], job varchar[64]);
> create table jobs (job_name varchar[64], salary float);
> insert into employees (emp_name,job) values ('JOE','CARPENTER');
> insert into employees (emp_name,job) values ('FRANK','PLUMBER');
> insert into employees (emp_name,job) values ('SUE','CARPENTER');
> insert into jobs (job_name,salary) values ("CARPENTER",25.50);
> insert into jobs (job_name,salary) values ("PLUMBER",28.75);
>

You could use XSLT to tranform the XML into the approriate SQL Statements.

Thomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Keary Suska 2009-05-06 16:28:01 Re: prepared statements and DBD::Pg
Previous Message Joao Ferreira gmail 2009-05-06 16:05:02 Re: XML -> PG ?