Ignore:
Timestamp:
12/03/07 23:34:44 (13 years ago)
Author:
selatham
Message:

nocs config etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/trunk/ingestAutomation/OAIBatch/SpaceTimeIngestFromMOLES.py

    r2262 r2263  
    3232def do_insert(Mid,west,south,east,north,startdate,enddate): 
    3333        sql = "INSERT INTO spatiotemp (id, coordinates, startdate, enddate) VALUES ( '"+Mid+ "', sbox'(("+west+"d , "+south+"d), ("+east+"d , "+north+"d))', '"+startdate+"', '"+enddate+"');" 
    34         #sql.replace("'null'",None) 
     34        sql.replace("nulld","null") 
    3535        print sql 
    3636        cursor = connection.cursor() 
     
    4343def do_update(Mid,west,south,east,north,startdate,enddate): 
    4444        sql = "UPDATE spatiotemp SET coordinates = sbox'(("+west+"d , "+south+"d), ("+east+"d , "+north+"d))', startdate='"+startdate+"', enddate= '"+enddate+"', update_time= now() WHERE id='"+Mid+"';" 
    45         #sql.replace("'null'",None) 
     45        sql.replace("nulld","null") 
    4646        print sql 
    4747        cursor = connection.cursor() 
     
    7171            no_bbox = False 
    7272            no_dates = False 
    73             east = 0 
    74             west = 0 
    75             north = 0 
    76             south = 0 
    77             startdate="January 1, 01 BC" 
    78             enddate="January 1, 01 BC" 
     73            east = 'null' 
     74            west = 'null' 
     75            north = 'null' 
     76            south = 'null' 
     77            startdate="null" 
     78            enddate="null" 
    7979            dgMeta=MRW.dgMetadata() 
    8080            try: 
     
    192192                #print "North = %s" %south 
    193193 
     194            print "west= %s,south %s, east %s, north %s, startdate %s, enddate %s" %(west,south,east,north,startdate,enddate) 
    194195            if id_exists( Mid ): 
    195196                print "INFO: doc %s exists, updating\n" %Mid 
     
    197198            else: 
    198199                print "INFO: doc %s does not exist, inserting new record\n" %Mid 
     200 
    199201                do_insert( Mid, west, south, east, north, startdate, enddate ) 
    200202            numfilesproc += 1 
Note: See TracChangeset for help on using the changeset viewer.