[sf-perl] Code Question
Brian Hamlin
bh1 at light42.com
Wed Jun 27 16:04:08 PDT 2007
Hello Perl Veterans
I have a question about DBI, Files and some XML. Useful References
appreciated.
I wrote a functional DBI program that just reads data on request,
invoked as a cgi, for light weight use. That works fine. The data is
returned as an XML structure that I write out manually using print.
Now, I want to do something more elaborate-
* read data from an external source (thats working, its a Salesforce
SOAP query)
comes back as XML, I use Soap::Lite
* Geocode the addresses in the table, add the results to the XML
structure
thats working already in an individual script, LWP get
* take a list of numbers in one field and make a separate "many to
many" table out of them
* take the rest of the data and make a table out of it
meaning, write SQL statements manually I suppose. I have that
working in individual scripts
a lot of things I have looked at look like more work to get started
that it is to do this by hand
I have an idiom someone showed me, which works, using a local array
with Field Names as a template
to write the SQL statements
* EXPORT the previous data via DBI and write it to a time-stamped text
file
eg MerchTBl_26Jun07.sql/xml/whatever
* REPLACE the contents of the table completely with the fresh data
the client is not going to pay for a custom system, I am only so
good at this so far
Each step is doable, especially since I have already solved many of the
unusual cases
manually once. It is really the rote, ordinary things that are new to
me, and of course, general
good practices, etc. I dont have the DBI cookbook
Code samples etc apropos to this are appreciated. I do read newsgroups
and books etc, but since
Perl has been around for a while, the volume of such things is very
large, and for someone getting
their footing its hard to wade through. Hence the question to the list.
thanks in advance
-Brian
More information about the SanFrancisco-pm
mailing list