Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Pulling together data from multiple tables
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tod Olson  
View profile  
 More options Jan 30 2012, 11:02 am
From: Tod Olson <t...@uchicago.edu>
Date: Mon, 30 Jan 2012 10:02:44 -0600
Local: Mon, Jan 30 2012 11:02 am
Subject: Pulling together data from multiple tables

I've used Scriptella for some simple ETL tasks, straightforward table-to-delimited text sorts of things. Now I have a more complex task, and I'm not certain how to attack it with Scriptella.

Complicating factors:

1. Data is in a few different tables in an RDBMS, and I need to pull the data together into XML files.
2. For any given record, it might have a single row in table1, and 0-N rows in table2, and table3
3. The keys are all the same in tables1-3, but the keys for table4 are in a column in table2

In a nutshell, the data in the RDBMS has a hierarchy to it, but that hierarchy makes the relations in the RDBMS rather complex, and export will require some business logic, likely non-trivial.

Does this sound like something I should even contemplate attacking with Scriptella, or should I just to straight to a custom export program?

Thank you for any input.

-Tod

Tod Olson <t...@uchicago.edu>
Systems Librarian    
University of Chicago Library


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fyodor Kupolov  
View profile  
 More options Jan 31 2012, 6:03 am
From: Fyodor Kupolov <scripte...@gmail.com>
Date: Tue, 31 Jan 2012 12:03:46 +0100
Local: Tues, Jan 31 2012 6:03 am
Subject: Re: Pulling together data from multiple tables

Hi Tod,

Described scenario is achievable with Scriptella, but be prepared to use
Java (or JavaScript) for implementing complex parts of business logic. For
complex migration scenarios I recommend a hybrid approach, when conceptual,
workflow level tasks are defined in XML, while some specific
transformations or business logic details are done in Java classes. So in
your example you can start with something like this:

<connection id="db"/>
<connection id="text" driver="text"/> <!-- Use pure text driver to output
XML - no validation or escaping. -->
<query connection-id="db"> <!-- start with main table1 -->
   select * from table1
   <script connection-id="text">
      <main-record id="${id}">
   </script>
   <query> <!-- find all records from table2 with the same id -->
       select * from table2 where id=?id
       <script connection-id="text"> <!-- output them -->
           <child-record>....</child-record>
       </script>
       <query connection-id="db">
           <!-- For each records in table2, find child rows in Table4 using
keys from Table2.
              Assume Table4keysColumn contains comma separated list of IDs.
              If it's not the case, consider writing helper Java method+use
Janino or play with ${"a,b,c".replace(";", ",")} -->
             select * from table4 where ID in ($Table4keysColumn);
            <script connection-id="text">
                <child-record4>....</child-record4>
            </script>
       </query>
   </query>
   <script connection-id="text">
      </main-record>
   </script>
</query>

Regards,
Fyodor


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fyodor Kupolov  
View profile  
 More options Jan 31 2012, 6:06 am
From: Fyodor Kupolov <scripte...@gmail.com>
Date: Tue, 31 Jan 2012 12:06:38 +0100
Local: Tues, Jan 31 2012 6:06 am
Subject: Re: Pulling together data from multiple tables

The ETL is just a skeleton, and have issues, e.g. please use <![CDATA[ ...
 ]]> to surround XML outputting parts.

On Tue, Jan 31, 2012 at 12:03 PM, Fyodor Kupolov <scripte...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »