# Zip Code Pull.r

qShowTables() [tablename %chin% extract("zip", tablename)]

.myf("^q")

qFindTable("zipqShowColNames")

qShowColNames("dim_zip")
qShowColNames("staging_dim_zip")

.myf("compare")
.myf("(set)")

allSetDiff(qShowColNames("dim_zip"), qShowColNames("staging_dim_zip"), A.="dim_zip", B.="staging_dim_zip")

## RESULTS:  Use dim_zip not staging_dim_zip

                 name     rows cols                            keys
1:    DB.iradio.event 22179572   14 apple_identifier, download_date
2: DB.iradio.customer 14487506    6
3:  DB.iradio.station  1436927    6
4:  DB.iradio.content  1208702   13 apple_identifier, download_date
5:        MetricScale       14    5                            pref

'iRadio_ImageSave_20131205_1925.Rda'
are(DBs)

jesusForData(DB.iradio.customer)

zips.using <- DB.iradio.customer[, levels(zip)]
head(zips.using)
DB.iradio.customer[zip == "00001"]


dim_zip <- runQry(paste0("SELECT * from dim_zip WHERE zipcode in ", pasteQ(zips.using), "\n"))
saveImageTo()
