MEMO

to: soares@herald.cs.columbia.edu
fr: menke@lamont.ldgo.columbia.edu (BILL Menke)

I have written a prototype time series retriever.  It works the
following way:

An initializarion file (called view_description) defines a number of
named views (tables) each with a given set of fields.  The user can
formulate queries on the records of one of these views.  Every record
has a field containing the filename of a timeseries.  The program formulates
an SQL query to return a list of these filenames.

The lamont.ldgo.columbia.edu anonymous ftp directory has the compressed
tar file oracle.tar.Z which has all the stuff.  There is currently only
one view defined, called:

shallow_events, with fields
	id
	lat
	lon
	depth
	algorith

yopu generate sql by the command line program (I have not had time
to write a GUI):

oracle_get_series view_name query left_lon right_log bottom_lat top_lat

for example


moses_114 >  oracle_get_series shallow_events "depth>=100" 30 60 40 80
VIEW NAME: <shallow_events>
SET SQLN OFF;
SET RECSEP OFF;
SET EMBEDDED OFF;
SET FEEDBACK OFF;
SET FLUSH OFF;
SET NEWPAGE 1;
SET LINESIZE 500;
SET PAGESIZE 100;
SET SPACE 1;
SET WRAP ON;
SET TAB OFF;
SET UNDERLINE \;
select
    ims.origin.filename,
from
ims.origin where
(ims.origin.depth >= 100.000000 )
and (ims.origin.depth < 1)
(( ims.origin.lon between 30.000000 and 60.000000 and ims.origin.lat between 40.000000 and 80.000000 ));



Here "shallow_events" is the view name, "depth>=100" is a test to be applied record-wise,
and "30", "60", "40" and "80" are the longitude and latitude bounds of a box on the earth.


The main program oracle_get_series.c, has a subsoutine call doitall( view, sql )
where view is a structure containing everything that is known about the current
view, including the name view->view_name and the location of its oracle database
server view->sql_server. "sql" the the character string containing the sql statement.

The current doitall() just writes the view_name and sql statement to stdout.
You can replace it with Concert code that actually invokes the sql process,
retrieves the filenames, and gets the files, and returns them.

Bill.
