[Thread Prev][Thread Next][Index]

RE: Question about negative longitude values in DB



I also thought I'd mention the version of mysql I'm running: Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386). This is the most current of the 3.x distribution.

Another database driver issue I've come up against: The SQL code that is generated to query the database will often contain a check against null values where the syntax is: SELECT latitude, longitude, time, salinity WHERE (salinity != NULL) AND ...
However, the mysql database will always return an empty set (as far as I can tell) when the != NULL syntax is used. My reading of the mysql documents is that this is the correct behavior because equality operators are not supposed to be used on NULL, the proper syntax would be (salinity IS NOT NULL). Is there an easy way to change this in the existing DBI driver?

Cheers,
Andrew

> -----Original Message-----
> From: Chase, Andrew [mailto:achase@mbari.org]
> Sent: Wednesday, November 17, 2004 10:37 AM
> To: 'Joe McLean'
> Cc: 'las_users@noaa.gov'
> Subject: RE: Question about negative longitude values in DB
> 
> 
> Hi Joe,
> 
> Funny you should ask that, I was just looking at the 
> insitu.pl file! I'm using a mysql database, and assuming I'm 
> reading the code correctly, I'm using the TMAP::DBI driver.
> 
> -Andrew
> 
> > -----Original Message-----
> > From: Joe McLean [mailto:joe.mclean@noaa.gov]
> > Sent: Wednesday, November 17, 2004 10:11 AM
> > To: Chase, Andrew
> > Cc: 'las_users@noaa.gov'
> > Subject: Re: Question about negative longitude values in DB
> > 
> > 
> > Hi Andrew,
> > Which TMAP Database driver are you using to extract the data 
> > from your 
> > database?  ($lasroot/xml/perl/TMAP/insitu.pl calls $db = which new 
> > package method)
> > Joe
> > -------------------------------------
> > 
> > Chase, Andrew wrote:
> > 
> > >Hi,
> > >
> > >I'm using a database to store non-gridded data and I've run 
> > into a problem with negative values for longitude. When I'm 
> > searching for data withing a bounded region, say -122 to 
> > -124, LAS translates that boundary to 238 to 236. When the 
> > query is sent to the database, the database doesn't do this 
> > translation, so the database query returns an empty set.
> > >
> > >My question is, can I configure LAS to work with negative 
> > values for lat/lon, or do I need to transfer them all to 
> > positive values before putting them in the DB? It's not a big 
> > deal to add 360 to the all the negative values, but I'd 
> > really like them to be as close to exactly the way they were 
> > coming out of their source file.
> > >
> > >Thanks,
> > >Andrew
> > >
> > >Andrew C. Chase
> > >Software Engineer
> > >Monterey Bay Aquarium Research Institute
> > >(831) 775-1865 :: Work
> > >(858) 349-3443 :: Cell
> > >  
> > >
> > 
> 


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement