Sunday, September 28, 2008

Extracting Ethicity Fields


Spent an hour on extracting the ethnicity fields (which in our case hold passport issuance information i.e. two digit country code [CA] followed by the country name [Canada]). I was trying to find out how Powerschool populates the drop down menu for a custom page that has that has teacher passport country. In the custom HTML for the page there was a tag for the drop down:
<select name="[05]Ethnicity" special="lists.ethnicity">
The Select is pulling from the TEACHERS table [05], but I couldn't figure out how it was populating the list choices from. It turns out that it is coming from the GEN table. The code is selecting form GEN and row where CAT is equal to 'Ethnicity'.

Knowing where that data was kept, I then opened excel up and connected to the GEN table through an ODBC connection to the Powerschool database. I filtered the data where CAT = 'Ethnicity and selected the NAME and VALUE columns.. the SQL is:
SELECT GEN.NAME, GEN.VALUE, GEN.CAT
FROM PS_MGMT.GEN GEN
WHERE (GEN.CAT='ethnicity')

I was then able to dump it right into Excel

No comments: